Yes, this file is attached. Inside, I simply added a short Russian word to an example I found online and then saved with the UTF-8 encoding. Nic ----- Original Message ----- From: "Murray Cumming" <murrayc murrayc com> To: "Nic Reveles" <Nic Reveles gatech edu> Cc: libxmlplusplus-general lists sourceforge net Sent: Tuesday, March 23, 2010 3:54:58 AM GMT -05:00 US/Canada Eastern Subject: Re: [libxml++] Also Have Problems with UTF-8 in Example Code: 'Glib::ConvertError' On Mon, 2010-03-22 at 18:28 -0400, Nic Reveles gatech edu wrote: > It seems I am having the same issue (or very similar) someone had back in 2008: http://sourceforge.net/mailarchive/forum.php?thread_name=481EEFF6.5020002%40balabit.hu&forum_name=libxmlplusplus-general > > > 1) copied the DOM parser code from the "short manual" (http://libxmlplusplus.sourceforge.net/docs/manual/html/ar01s02.html#id2504579) > 2) compiled it without problem > 3) ran it on a simple "example.xml" file. Could you attach that example.xml file, please. > > It crashes with 'Glib::ConvertError'. Removing the UTF-8 characters fixes the problem, but obviously that's not a great solution. Also, if I do not attempt to 'cout' the field with UTF-8 characters, it also does not crash, but I need to output the field. > > The example output is as follows: > ~~~~~~~~~~~~~~~~~ > Node name = note > Node name = note > line = 10 > > Node name = to > Node name = to > line = 11 > > Text Node > text = "Joe" > > Node name = from > Node name = from > line = 12 > > Text Node > text = "Jany" > > Node name = heading > Node name = heading > line = 13 > > Text Node > text = "Reminder > > Node name = body > Node name = body > line = 14 > > Text Node > terminate called after throwing an instance of 'Glib::ConvertError' > Abort trap: 6 (core dumped) > > ~~~~~~~~~~~~~~~~~ > $ cat example.xml > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE note [ > <!ELEMENT note (to,from,heading,body)> > <!ELEMENT to (#PCDATA)> > <!ELEMENT from (#PCDATA)> > <!ELEMENT heading (#PCDATA)> > <!ELEMENT body (#PCDATA)> > ]> > <note> > <to>Joe</to> > <from>Jany</from> > <heading>Reminder</heading> > <body>ÐÑивеÑ! Don't forget me this weekend!</body> > </note> > ~~~~~~~~~~~~~~~~~~~ > > I'm running freeBSD 8.0: > $ uname -a > FreeBSD selever 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009 root mason cse buffalo edu:/usr/obj/usr/src/sys/GENERIC amd64 > > In general, is it rather difficult to output UTF-8 (requiring special environments)? Any help, tips, or advice would be most appreciated. > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Libxmlplusplus-general mailing list > Libxmlplusplus-general lists sourceforge net > https://lists.sourceforge.net/lists/listinfo/libxmlplusplus-general -- murrayc murrayc com www.murrayc.com www.openismus.com
Attachment:
example.xml
Description: application/xml