[email protected] wrote:
> Hi , when i want parse xml string in my application
> will coredump in getElementByTagName
> 
> xmlString sample :
> In this xml string exist chinese word
> <?xml version="1.0" encoding="UTF-16" standalone="no"?><Transaction><Car
> ObjType="Obj_ID" Value="car1"/><memo ObjType="claimMemo">@DIF||編號
> </memo></Transaction>
> 
> sample code :
> 
> try
> {
>       DOMNodeList * nodelist  =
> root->getElementsByTagName(XMLString::transcode("Car")) ;   --->> this will
> coredump
> in my application can't get any exception !!!
Do not use XMLString::transcode(), because it relies on the local code page.

If you need to use constant strings like this in your application,
create UTF-16 strings, such as you'll find in util/XMLUni.cpp:

const XMLCh XMLUni::fgAnyString[] =
{
    chLatin_A, chLatin_N, chLatin_Y, chNull
};

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to