Garbled Chinese characters in Flash text input

Last time I ran into the problem of Flash’s NavigateToURL being blocked in IE, and the fix was to set wmode. Last night I hit another wmode problem: a text input field in Flash (a genuine TextField in CS4, type=’input’), once embedded in a web page, couldn’t take Chinese input properly in Firefox — the IME worked, but everything typed came out garbled.

Flash

The Ultimate Fix for Garbled Text When Flash Fetches PHP-Generated XML

I’m never one to back down from wrestling with the most bizarre problems—let’s see who comes out on top. It’s been ages since I hit an obstacle while coding, yet today I ran into a little snag—XML generated by PHP came out as garbled text when fetched with FLASH. After some digging I finally solved it. Recording it here, and also jotting down the general solution. If you also run into XML <-> FLASH garbled text, here’s a quick reference: 1. When you’re certain the XML is absolutely fine:First, FLASH reading XML and getting garbled text involves the static property System.useCodepage. Official description: “A Boolean value that tells Flash Player which code page to use to interpret external text files.” Defaults to false.

Flash