Re: [xml] SAX API returns wrong length for characters containing non-ASCII



No it does not and a quick test shows that this is my mistake :)!

Thanks a lot!

Am Dienstag, den 25.06.2013, 19:57 +0200 schrieb Bjoern Hoehrmann:
* Ludwig Weiß wrote:
I'm trying to parse a xml document with the SAX API. The document containts
some some german "umlaute". A short example:
<?xml version="1.0" encoding="UTF-8"?>
<Mediathek>
<X><n>hello from Köln</n><g>http://www.koeln.de</g></X>
<X><n>öhello from Köln</n><g>http://www.koeln.de</g></X>
</Mediathek>

The callback to my charactersSAXFunc tells me the String inside <n>...</n>
of the first line has a length of 12. So the String I save for later use is
just "hello from K".

SAX implementations are allowed to call the characters callback more
than once for a given text content. Does your code account for that?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]