Flash and HTML entities continued…
Follow-up to Flash for Rich Internet Applications? I think not. (rant) from [Ux]
Note that you can’t currently embed all characters from multiple languages in a SWF, only English and the current language such as Japanese will work correctly. Also, embedding glyphs for fonts such as Japanese can increase the size of the SWF significantly.
After a bit more research, it looks like there’s no easy fix for diplaying a mix of Latin and Asian characters in Flash from an ISO-8859–1 file. The problem is twofold;
- Flash only supports and can only display a limited set of HTML entities
- Flash fully supports Unicode (as UTF-8) but it’s tied to the OS codepage
The first thing I tried was to transform each entity into it’s Unicode equivalent; this works, but only for Latin-1 characters on my pc. The problem is this; Flash might support Unicode but it checks what codepage the system uses, and it only ever renders a font in that codepage. Which means that a user that has their system set to display asian fonts will see the right output, but if the system language is set to English or Arabic etc. those characters simply don’t appear. Grrr. What’s really annoying about this is that most browsers support mixed language display, using system fonts like Arial Unicode MS, a 23Mb font package that contains character sets and glyphs for most languages – but embedding a 23Mb font into your Flash movie so that you can force a textfield into using a certain font is unacceptable.
I tested some blog feeds with a Flash RSS reader at Newsmonkey and it displays exactly the same problem as I’m having.
So, what to try next?
- A simple test that forces Flash to any _sans font, to see if it picks up a font set containing the glyphs.
- There are ways in XP (using a registry mod) to ’split’ Arial Unicode MS into a number of smaller font sets, categorised by language, this can then be embedded into the movie, but after a quick test this appears to be hit by the codepage problem again. From Flash 5 on there is support for an override of the codepage using System.useCodepage = true, which forced Flash to adopt the native settings, but again this doesn’t allow a mix of Latin and Asian characters and furthermore Macromedia doesn’t recommend it, because it effectively removes the advantages of using Unicode in the first place.
- Experiment with UTF-8 encoded versions of the XML with the characters just written in, and see what happens.
None of which get away from post-processing the entities; potentially a big job

