[xml] Question about using SHIFT-JIS encoding with libxml2



Hi,
 
I am using libxml2 for xml parsing. When the client application sends data to libxml2 in UTF-8 format, it works fine.
 
But, I have a scenarion in which the client application sends data to libxml2 parser in SHIFT-JIS format.  
 
I have added the encoding declaration to the XML as follows  -
<?xml version="1.0" encoding="SHIFT-JIS"?> 
 
The following error is thrown by libxml2 -
 
"Parsing error in results: Input is not proper UTF-8, indicate encoding ! " 
 
In libxml2 documentation at http://www.xmlsoft.org/encoding.htmlI read that libxml2 can support any encoding by calling the xmlSwitchEncoding() routine.
What do I have to do to make libxml2 support SHIFT-JIS format? I want to continue supporting UTF-8 also.
 
 
Thanks,
Saumya


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]