Flex tutorial: Convert unicode (UTF16) to text, and vice verse
February 27, 2009In contrary to most mashup api services that uses UTF8, Twitter returns non-Latin characters encoded in UTF16. After googling, seems like many people have issues with converting UTF16 encoded characters to proper text and vice verse. There might be other better ways, but here’s what I have done. Feel free to comment.
A UTF converter that I always used is this.
Demo:
Unicode Converter (view source enabled)
Source Codes
Right-click on application to view source.
3 Comments »
Leave a comment
This blog is powered by WordPress with GimpStyle Theme design by Horacio Bella.





March 25, 2010 at 08:03 am
Hi, first of all excellent post !
I downloaded the files from the source code view, and tested the app locally, but the labels from the RadioButton (お元気ですか and お元気ですか), are not showing at all, so when I click the buttons nothing shows on the TextAreas either.
I tried adding the unicode range of the characters on flex-config.xml, but didn’t work. I don’t think the font it’s the problem because I have “Arial” installed.
When I run the app from your website it works very well, but locally … well the characters won’t show
I don’t know what else to try, hope you can help me , thank you!:)
March 25, 2010 at 09:03 am
Ok I kind of solved it, I removed everything in , then ran the app, and the labels (お元気ですか and お元気ですか) at last showed.
But then I was testing with other unicode symbols and did this:
– changed the labels to : ♠♡♢♣
-added U+2660-U+2663, in the unicode range on @font-face
-also the unicode range of the characters on flex-config.xml, just in case
The result : of the 4 characters, only the first and the second were showing ( ♠ and ♣), but the two in the middle weren’t ( ♡♢ ). The strange thing is that the unicode numbers are consecutive ( U+2660, U+2661, U+2662 and U+2663)
I wonder why the two characters won’t show, hope you can help me , thank you again
March 25, 2010 at 09:03 am
sorry , my bad :
“The result : of the 4 characters, only the first and the LAST were showing ( ♠ and ♣) ..”