Writing to file in utf-8

Trevor DeVore lists at mangomultimedia.com
Wed Sep 3 11:19:58 EDT 2014


On Wed, Sep 3, 2014 at 7:28 AM, <jbv at souslelogo.com> wrote:

> I have a script that accumulates successive strings into a file.
> Each string comes from utf-8 text files and contains french
> characters with accents like "é à ô".
> After processing in the script, those strings get accumulated
> in other txt files. I need these second serie of files to be in
> utf-8 format too.
> ...
>
> put (unidecode(it,"utf8") & return) after url tPath
>

Why are you using unidecode? Unless you are converting the data you read in
to UTF16 data using uniencode then you are passing bad data to unidecode.
unidecode expects UTF16 data. Based on what I've read you shouldn't need to
use unidecode or uniencode. Just read the text in (using binfile),
manipulate it, write the text out (using binfile).

-- 
Trevor DeVore
ScreenSteps
www.screensteps.com    -    www.clarify-it.com



More information about the use-livecode mailing list