Game Development Community

UTF-8 XML

by Alexandre Ribeiro de Sa · in Torque Game Builder · 11/06/2009 (2:28 pm) · 2 replies

Hello everyone, I have some problems when I try to read UTF-8 XML files, always return error, when I write the same file as ANSII it works, it's isn't a true problem in english, but return strange characters when I use latin characters...


All the best!
Alexandre


#1
11/06/2009 (9:47 pm)
I've forgot the code, here what I'm doing...

echo(expandFileName("./data/language/" @ %projectFile @ "/about.xml" ));
    %xml = new ScriptObject() { class = "XML"; };
    if( %xml.beginRead( expandFileName("./data/language/" @ %projectFile @ "/about.xml" ) ) )
    {
        if( %xml.readClassBegin( "MCMN_ABOUT" ) )
        {
            %xml_Contet = %xml.readData( "CONTENT" );
            %xml.readClassEnd();
            gui_contentAbout.setText( %xml_Contet );
			echo( %xml_Contet );
        }
        else
      	    echo ("erro chave");

        %xml.endRead();
    }
    else
   	    echo ("erro");

    // Delete the object
    %xml.delete();
#2
11/07/2009 (12:26 am)
found a solution, build the XML file in Visual Studio, so the problem was the editor (Context)...