1 person found this helpful
My understanding is that Flash Player uses UTF-16 "surrogate pairs" to represent Unicode characters outside the BMP. Such a pair appears as two "characters" to AS APIs such as String.length and String.charCodeAt() but the renderer should render them as the correct single character. Whether selection and editing operations in the Player 9's TextField class respect surrogate pairs is something that I'm not sure of, but the new flash.text.engine (FTE) APIs in Player 10 are supposed to understand them, as is the Text Layout Framework (TLF) built on top.
Adobe Flex SDK Team
How to tell whether a "character" (really a UTF-16 code unit) in an AS String is actually part of a surrogate pair:
D800..DBFF: high surrogate
DC00..DFFF: low surrogate
everything else: a character
Thanks for your help! Yes, I had already refreshed my memory about UTF-16 when I saw your first reply, which mentioned surrogate pairs.
Btw it would have been nice if the Flex documentation had explained this. Hopefully the documentation of Flex 4 will do a better job.
I saw your post yesterday. I've been unable to get UTF-16 surrogate pairs working in my code. You can read about it here:
Any help would be most appreciated.