Re: [xml] Unicode VS XML: Need help with char encoding in XML



On Mon, Jul 22, 2013 at 04:43:47PM -0400, Liam R E Quin wrote:
On Mon, 2013-07-22 at 20:07 +0000, Fred Smith wrote:
I imagine my problem is due to my own ignorance of how char encodings work and how libxml2 handles them, 
but I’m growing frustrated with my inability to figure it out so thought to beg advice from the list.

    snprintf (tststr, sizeof(tststr), "Test %c Test", 0xC9);

You are generating something not valid as a Unicode text string in
UTF-8, the default encoding.

try, snprintf (tststr, sizeof(tststr), "Test %c%c Test", 0xC3, 0x89);

  reading the doc may help too
    http://xmlsoft.org/encoding.html

This email and any files transmitted with it are confidential

No. They are not confidential. You have sent them to a public archived
mailing list. I have answered your question even though I am clearly not
the "intended recipient". Please in future do not send confidential mail
to public lists.

  Indeed, fix your mail, or post from gmail (for example), that's
inappropriate:

   http://xmlsoft.org/bugs.html

c.f. the section in red,

 thanks,

Daniel

-- 
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]