On Sun, 2008-05-04 at 12:34 +0200, Nicolas wrote: > Murray Cumming wrote: > > On Sun, 2008-05-04 at 00:06 +0200, Nicolas wrote: > > > >> Hello! > >> > >> I tried to parse utf8 .xml files with the sample program > >> example/sax_parser/ (i've tried with both 2.20 and 2.23 versions). The > >> program crash during the execution at the position of the first utf8 > >> char with the following message : "terminate called after throwing an > >> instance of 'Glib::ConvertError' > >> 20 Abandon (core dumped)" > I didn't change the code of the libxml++ example program contained in > the "example/sax_parser/" directory. Thanks. I have added some try/catches to examples/sax_parser/myparser.cc in svn to show where the exception is being thrown. It is indeed happening during std::cout << when trying to print out that chinese from the attribute value. And I can reproduce it even with this simple attached .xml file. However, I don't understand why this is happening. Investigating only confused me more: g_utf8_validate() does not fail on the string, but g_locale_from_utf8() does. That makes no sense to me so I am beginning to suspect that something is wrong with my Ubuntu Hardy? What distro are you using? Can anyone else reproduce this problem? -- murrayc murrayc com www.murrayc.com www.openismus.com
Attachment:
index.xml
Description: application/xml