Log in

View Full Version : Character encoding error



danielbento
08-05-2008, 02:22 PM
I'm sending some text from PHP to flash, but, despite trying several solutions, it keeps having some character errors, due to accentuation from portuguese language.

The way i am sending the vars to flash is throw get method :

echo 'var so = new SWFObject("anima/advertencia.swf?dbaviso='.$aviso.'", "advertência", "145", "170", "9", "#FFFFFF");';

Can anyone help me on this?

Medyman
08-05-2008, 07:24 PM
By default, Flash reads all external code as Unicode. So, if your text isn't saved as Unicode or is encoded using some other encoding method, this could cause problems.

The fix for this is to use:
System.useCodePage = true;Setting System.useCodePage to true means that Flash will then use whatever the OS's default encoding is.

More info. (http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary723.html)

danielbento
08-06-2008, 03:57 AM
The problem was solved.

The error was in the html page, in the charset encoding.

I change to "UTF-8" and it solved the problem.

Thanks fow your help