1 Reply Latest reply on Aug 29, 2007 10:42 AM by jl2000

    Loading ISO-8859 (Latin1) characters from XML

    sake_boy
      Have some experience loading XML files, but this is a new issue to me. I see my accented characters displaying properly in my text editor. And I've confirmed that my font is OK in Flash by testing a dynamic text box--the accents in the test appear OK, so it's not the XML file or the font, it seems to be the XML loader itself.

      My XML file looks like this (there are Latin accented characters in the text node:

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <projects>
      <project id="0">
      <_iID>0</_iID>
      <_sProjectDescription>La piratería es una práctica, tan antigua como la navegación misma, en la que una embarcación privada o una estatal amotinada ataca a otra en aguas internacionales o en lugares no sometidos a la jurisdicción de ningún Estado, con un propósito personal para robar su carga, exigir rescate por los pasajeros, convertirlos en esclavos y muchas veces apoderamiento de la nave misma.</_sProjectDescription>
      </project>
      </projects>

      BUT, once Flash loads the XML, I trace it out and the output misses these characters:
      <_sProjectDescription>La pirater?a es una pr?ctica, tan antigua como la navegaci?n misma, en la que una embarcaci?n privada o una estatal amotinada ataca a otra en aguas internacionales o en lugares no sometidos a la jurisdicci?n de ning?n Estado, con un prop?sito personal para robar su carga, exigir rescate por los pasajeros, convertirlos en esclavos y muchas veces apoderamiento de la nave misma.</_sProjectDescription>

      Is this a known issue I don't know about? I can't find anything in the documentation and have scoured the web for hours for an answer.

      Any help would be greatly appreciated! Below for reference is my load function for reference.Thanks.

      SB

      --

      function loadXML()
      {
      trace("loadXML()");
      map_xml.ignoreWhite = true;
      map_xml.onLoad = function(success:Boolean) //handleLoad becomes a method of map_xml
      {
      if(success)
      {
      trace("loadXML: XML Status: " + map_xml.status);
      trace("loadXML: XML load success. XML:");
      trace(map_xml);
      handleXMLLoad();
      }
      else
      {
      trace("loadXML: ***ERROR - map_xml.load FAILED.*** Status/Error code: "+ map_xml.status);
      }
      }
      map_xml.load("xml/Map_data.xml"); //read from XML file.
      }
        • 1. Re: Loading ISO-8859 (Latin1) characters from XML
          jl2000 Level 1
          sake_boy,
          Here are two suggestions;

          1-Make sure your text editor is saving your XML file as Unicode with UTF-8 Encoding.

          2-I've had success using symbol entities to replace the accented letters. For example: the lowercase o with an acute accent is replaced with &#242.

          (I use www.w3schools.com/tags/ref_entities.asp as my source for the ISO 8859-1 Character Entities.)

          I hope that helps.
          JL