[Extendflash] Using the JSFL FLFile.write and UTF8

Morten Barklund Shockwaved morten.barklund at shockwaved.com
Fri Aug 5 23:46:20 PDT 2005


> u r correct, this is the current behavior.
> 
> just out of curiosity. what situation r u running into which requires 
> the BOM [byte order marker] at the start of the UTF8 file?

I've made a little JSFL script, which creates a lot (126 actually) of 
actionscript2 class files for me. This includes some generel warning 
messages written in danish including special characters. This generated 
a UTF8-encoded file (or at least the characters were in UTF8), but 
without the BOM. Thus when read into my flash production, the files were 
included as if they where written in Latin1 - and my characters became 
fubar - or at least beyond the client's recognition :)

I've made a little workaround using a function, that converts the six 
special characters, that my use is limited to, into their 
utf8-urlencoded entities. That is, what the escape function would 
produce, if working on UTF8 characters. But the escape function cannot 
be used, as the characters in the JSFL script is actualle evaluated as 
Latin1. Then in my script, the files including these auto-generated 
classes simply unescape's the strings before use. This sounds 
complicated, but actually the unescape function is only applied in one 
place - as all warning messages from these files go through here.

But why JSFL doesn't use UTF8 and unicode is beyond me!

-- 
Morten Barklund - Information Architect - Shockwaved ApS
Larsbjoernsstraede 8 - DK-1454 Copenhagen K, Denmark
Phone: +45 7027 2227 - Fax: +45 3369 1174


More information about the Extendflash mailing list