Re: [xml] xmlReadDoc and UTF-16LE



  Oops forgot yo reply on the list :-)

Daniel
On Fri, Feb 13, 2015 at 06:26:54AM +0100, Daniel Veillard wrote:
On Mon, Dec 29, 2014 at 05:07:54PM +0100, Denis wrote:


Is there a way to read a UTF-16LE Xml document with xmlReadDoc?
 
Using this line of code
_document = xmlReadDoc( reinterpret_cast< const xmlChar * >( data.c_str() ), 
0, "UTF-16LE", XML_PARSE_PEDANTIC | XML_PARSE_NOBLANKS | XML_PARSE_NONET )
 
instead of
_document = xmlReadDoc( reinterpret_cast< const xmlChar * >( data.c_str() ), 
0, 0, XML_PARSE_PEDANTIC | XML_PARSE_NOBLANKS | XML_PARSE_NONET )
 
sames to have no effect.

  that should work, XML documents start with a '<' character and
libxml2 tries to guess UTF-16LE from UTF-16BE by watching the first
bytes of the document. Provide the document if you want to investigate
the issue further,

 thanks,

Daniel

www.denisgottardello.it
GMT+1
Skype: mrdebug
Videosurveillance and home automation! 
http://www.denisgottardello.it/DomusBoss
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
https://mail.gnome.org/mailman/listinfo/xml

-- 
Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/


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