Re: [xml] libxml2
- From: Daniel Veillard <veillard redhat com>
- To: ÐÐÐÐÐÑÐÐÐ ÐÑÐÑÐÐÐ <vladislav stoyanov redsolution ru>
- Cc: xml gnome org
- Subject: Re: [xml] libxml2
- Date: Thu, 7 Jul 2011 09:48:52 +0800
On Wed, Jul 06, 2011 at 12:34:03PM +0600, ÐÐÐÐÐÑÐÐÐ ÐÑÐÑÐÐÐ wrote:
Hello.
I've got a problem with libxml. When I add Cirilic attribute to XMLNode it
converting to UTF-8 and than quot every symbol.
When you use libxml2 API you must pass only UTF-8 strings when there
is an xmlChar *, if you don't you may see the kind of behaviour you are
seeing.
It happens in xmlCharEncOutFunc in encoding.c file.
This function quotate UTF-8 of all attributes, but some XMPP servers can't
unquote it and we can get something like ТЕмыч
as a nickname of buddy in our contactlist.
Either those XMPP applications don't use an XML parser to parse XML, or
you made a mistake when using libxml2 made it convert it to that string.
Make sure you are saving to UTF-8 when talking to XMPP too.
paphio:~/XML -> cat tst.xml
<foo attr="ТЕмыч"/>
paphio:~/XML -> xmllint tst.xml
<?xml version="1.0"?>
<foo attr="ТЕмыч"/>
paphio:~/XML -> xmllint --encode UTF-8 tst.xml
<?xml version="1.0" encoding="UTF-8"?>
<foo attr="ÐÐÐÑÑ"/>
paphio:~/XML ->
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]