PDA

View Full Version : Foreign Characters


The Brow
02-16-2009, 08:55 PM
I'm trying to figure out how to output characters from foreign languages in Flex and ActionScript.

To start, I'm just trying to output Cyrillic in a text control, but its just not working.

Ive tried BOM (Byte Order Marks) indicating UTF-8 in the XML file containing the text. I also specified "<?xml version="1.0" encoding="UTF-8"?>" in that file, and also in the actual MXML file. The actual text control is in a seperate AS3 file without a BOM, but I'm compiling everything with -actionscript-file-encoding="UTF-8".

The original cyrillic text came from an html file with a BOM indicating utf-8. I can paste that text into any html file with the same BOM and it displays correctly; take out the BOM and its garbage, so all that is needed is the correct Byte Order Mark at the start of the html file.

But anyway, nothing works in flex/actionscript.

francislow82
02-17-2009, 02:28 AM
Hi, the text is loaded from an xml? Have you tried embedding the characters?

The Brow
02-17-2009, 06:32 AM
Yes. The fonts are embedded.
The fonts are in seperate .SWF file - a font library, and the xml file tells the main application which font library to load (Font.registerFont(SWFLoader(event.target).content['wrFont']))

I'm also compiling these font .swf's with the -actionscript-file-encoding="UTF-8" option. I get nothing where the Russian characters are supposed to be.