java - SAXParser implementation is skipping entities -


i have implementation of org.xml.sax.helpers.defaulthandler, works fine except when comes this:

<name>ji&#345;&#237; b&#225;rta</name>

the character method overriden as:

 @override public void characters(char[] ch, int start, int length) throws saxexception {     if (currentelement) {         currentvalue = new string(ch, start, length);         currentelement = false;     } } 

but char array arrives method has 'ji', skipping rest of string. have method convert entities utf-8, never them, can't convert anything.

be aware parser may not deliver character data in 1 call. safe must build string possibly several characters() invocations, bracketed startelement()/endelement().

as side note, why want convert "entities" utf-8? converted utf-16 characters.


Comments