Jump to content

Special Characters in XML


ember

Recommended Posts

Hello everyone,i have a flash project in wich i use a XML database to load the menu, but i don't know why, it doesn't work correctly when using special characters (Ç, À, ã, etc...)i need to use those characters because in my native language some words that use those characters don't make sense without them...i've already tried to create the xml file as UTF-8, and also adding

System.useCodepage = true;

to the actionscript.any ideas on how to solve this?best regards,ember

Link to comment
Share on other sites

Are you sure you've saved the file as UTF-8 and declared UTF-8 as the encoding in the XML prolog?In other words, in Notepad, when you click "Save As...", are you sure you've selected "UTF-8" in the "encoding" drop down?In additon, since (I suppose) Flash is receiving the XML from the client side (i.e. it's asking the server), make sure the server is sending the XML with the right MIME type "application/xml". The other possible MIME type "text/xml" uses a different encoding.

Link to comment
Share on other sites

Are you sure you've saved the file as UTF-8 and declared UTF-8 as the encoding in the XML prolog?In other words, in Notepad, when you click "Save As...", are you sure you've selected "UTF-8" in the "encoding" drop down?In additon, since (I suppose) Flash is receiving the XML from the client side (i.e. it's asking the server), make sure the server is sending the XML with the right MIME type "application/xml". The other possible MIME type "text/xml" uses a different encoding.
thanks for your fast reply :)yes, i've saved the file as UTF-8.however, i don't know where to change the MIME type setting... is it on the flash file or on the xml?best regards,ember
Link to comment
Share on other sites

Neither. It's a setting on the server where the XML file is.You can view the current MIME type with a tool like Fiddler (see my signature) or Firebug.And you can set the MIME type either via a control panel provided by your host, or by creating a file called ".htaccess" in your area with this content:

AddType application/xml .xml

(The .htaccess file itself should be ancoded as ANSI. If you get that one wrong you'll see HTTP error 500 when you access your site.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...