I know this isn't the user mail list... But I couldn't find one... And I have a problem. So PLEASE help me :_(

I'm using xerces to read a config file to get multilanguage support:
It looks like this...

<?xml version="1.0" encoding="UTF-8"?>
<Language>
 <Phrase key="OutOfMemory">Slut p� minne</Phrase>
 <Phrase key="FileNotFound">Filen kunde inte hittas</Phrase>
</Language>

Now, I'm new to both xerces and unicode. I wonder how do I get the string that corresponds to a key and put it in a string or something as UTF-8?
I tried somthing like this...


void Unicode::ReadStrings(DOMNodeList* pNodes)
{
  DOMCharacterData* child;
  DOMElement* attribute;

  int node_list_length = pNodes->getLength();
  for (int i = 0; i < node_list_length; ++i)
  {
     attribute = dynamic_cast<DOMElement*>(pNodes->item(i));

     child =
        dynamic_cast<DOMCharacterData*>(pNodes->item(i)->getFirstChild());

     cout << "Length: " << child->getLength() << endl;
     // if p_element is NULL the node is probably a comment
     if (child != NULL)
     {
       string text_string = XMLString::transcode(child->getData());
        AddString(key, text_string);
.............

child->GetData() returns an XMLCh* containing for example 'Slut p� minne'.'
But when I tried to use that string in SDL_ttf to print a UTF8 string on the screen it only works as long as the string contains ASCII charaters... When I put an �, � or � in it doesn't work...
Also, when I try to print text_string with cout it doesn't work when I try to use special chatares...


Thanks in advance... And sorry for taking up your time
Daniel

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to