DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21393>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21393 Xerces UTF-8 Character Encoding/Decoding issues Summary: Xerces UTF-8 Character Encoding/Decoding issues Product: Xerces-C++ Version: 2.3.0 Platform: PC OS/Version: Windows NT/2K Status: NEW Severity: Normal Priority: Other Component: DOM AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Hi, I got one Japanese XML which is encoded using UTF-8. If I do a string comparison of File Content before parsing and Data regenerated from the Parser, I am finding difference at the place where Japanese characters are inserted. How can I get the same data from the parser back. Or is there anything I shoulld do inorder to make it working. Here is the code: void main(int argc, char* argv[]) { XMLPlatformUtils::Initialize(); XercesDOMParser *parser = new XercesDOMParser; char* lpBuf = ReadFromFile("D:/TEMP/Japanese/BasicConfig_SJIS_All.xml"); if(lpBuf) { Parse(lpBuf, parser ); } delete parser; } bool Parse(const char* lpszStr, XercesDOMParser *pParser ) { char Temp[40] =""; strcpy(Temp,"GG.Doc.1.XML"); MemBufInputSource m_Source( (const XMLByte*)lpszStr , strlen(lpszStr) , Temp , false ); try { pParser->parse(m_Source); } catch(...) { return false; } DOMNodeList* pNodes = pParser->getDocument()->getElementsByTagName(X("*")); if(!pNodes->getLength()) return false; DOMNode* n = pNodes->item(0); CGGString str; str.SetLineFeed("\r\n"); str << "<?xml version=\"1.0\" encoding=\"shift-jis\"?>" << endl; str << n; int Offset=0; int iDiff = Compare(lpszStr,str.GetBuffer(),Offset); return true; } Thanking you in advance -- Firoz --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
