creating a Unicode (UTF-8) file using open/write/close file

Dar Scott dsc at swcp.com
Wed Sep 24 19:50:01 EDT 2003


On Wednesday, September 24, 2003, at 01:15 PM, Trevor DeVore wrote:

> The Japanese characters were turned into garbage characters when I 
> opened the file in BBEdit.  Is it possible to write a UTF encoded text 
> file with Rev?  If so, how?

Yikes.  My response ignored the UTF-8 need.  Do you actually prefer 
UTF-8 to UTF-16?  For file size?

Are you actually getting the chars from a field?

If all true, then you seem to need a function to convert from UTF-16 to 
UTF-8.

But, if you can get by with UTF-16, then maybe you just need the BOM.  
Creating the BOM might be simply setting useUnicode to true and 
returning numToChar(-2); worth a try anyway.

Dar Scott











More information about the use-livecode mailing list