[Extendflash] Using the JSFL FLFile.write and UTF8
Till Schneidereit
zooey at gmx.net
Sun Aug 7 14:05:51 PDT 2005
Morten,
> 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.
Here's a trick from the bad old Flash MX days, when there was no way to encode AS files as utf8:
Instead of url-encoding the characters, you can also utf8-escape them. The advantage is that utf8-escaped characters get decoded automatically when the script is read. (I think. Decoding might also happen when the bytecode is interpreted, but that's not of much practical difference, really.)
To encode a character as a utf8 escape sequence, you'll have to know the sequence, as there's - to my knowledge - no way to automatically do this. If you're working in Windows, you can find out the correct sequence for a character by using the Character Map (under Start / Programs / Accessories). If you select a character in that Tool, the escape sequence is shown in the lower left corner of the window. E.g., for the character "å" (I hope this doesn't get mangled by the all-mighty system that is global email communication ;-)), the sequence is "U+00E5".
To encode the sequence, you replace the character by "\u" followed by the four digit escape sequence (in the case of "å" that would be "\u00e5").
cheers,
till
More information about the Extendflash
mailing list