If you start with a valid XML fragment, that uses strings in the same encoding that is listed in the XML header, you will get back valid strings regardless of the language they use....
Alberto [email protected] ha scritto: > thanks Alberto, > > ok , i will check the root is a NULL pointer , > so , if i translate chinese word to UTF-16 string , > i will get the right information ? > > > > ----- Forwarded by Y_TZENG/GUEST on 2009/05/08 下午 03:59 ----- > |---------------------------------> > | Alberto Massari | > | <amass...@datadirect.| > | com> | > | | > | | > | 2009/05/08 下午 03:54| > | | > | | > | Please respond to | > | [email protected]| > | rg | > | | > |---------------------------------> > > >----------------------------------------------------------------------------------------------------------------------| > | > | > | > | > | > To| > | [email protected] > | > | > cc| > | > | > | > Subject| > | Re: Memeory coredump in getElementsByTagName > | > | > | > | > | > | > | > | > | > | > | > > >----------------------------------------------------------------------------------------------------------------------| > > > > > Have you checked if root is a NULL pointer? Maybe the parsing failed > because that chinese word is not written using a correct UTF-16 string... > > Alberto > > [email protected] ha scritto: > >> 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 !!! >> } >> catch( const DOMException& exception) >> { >> char * message = XMLString::transcode(exception.getMessage()); >> cout << message << endl; >> XMLString::release(&message); >> return 1 ; >> } >> catch( const XMLException& exception) >> { >> char * message = >> > XMLString::transcode(exception.getMessage()); > >> cout << message << endl; >> XMLString::release(&message); >> return 1 ; >> } >> catch( const SAXException& exception) >> { >> char * message = >> > XMLString::transcode(exception.getMessage()); > >> cout << message << endl; >> XMLString::release(&message); >> return 1 ; >> } >> catch (...) >> { >> cout << " catch ... " << endl ; >> return 1 ; >> } >> >> >> >> >> >> >> > --------------------------------------------------------------------------- > > >> TSMC PROPERTY >> > > >> This email communication (and any attachments) is proprietary >> > information > >> for the sole use of its >> > > >> intended recipient. Any unauthorized review, use or distribution by >> > anyone > >> other than the intended >> > > >> recipient is strictly prohibited. If you are not the intended >> > recipient, > >> please notify the sender by >> > > >> replying to this email, and then delete this email and any copies of it >> > > >> immediately. Thank you. >> > > > --------------------------------------------------------------------------- > > >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > --------------------------------------------------------------------------- > TSMC PROPERTY > This email communication (and any attachments) is proprietary information > for the sole use of its > intended recipient. Any unauthorized review, use or distribution by anyone > other than the intended > recipient is strictly prohibited. If you are not the intended recipient, > please notify the sender by > replying to this email, and then delete this email and any copies of it > immediately. Thank you. > --------------------------------------------------------------------------- > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
