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/ [email protected] | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
