-
Notifications
You must be signed in to change notification settings - Fork 659
Closed
Description
After switching to 1.2.2, the hyphenation does not work anymore.
The reason seems to be the UniversalDetector class which does not recognize the encoding of the XML files from the itext-hyph_xml.jar
Code snippet from class SimpleXMLParser:
public static void parse(SimpleXMLDocHandler doc, InputStream in) throws IOException {
byte b4[] = new byte[4];
int count = in.read(b4);
if (count != 4)
throw new IOException(MessageLocalization.getComposedMessage("insufficient.length"));
UniversalDetector detector = new UniversalDetector(null);
detector.handleData(b4, 0, count);
String encoding = detector.getDetectedCharset(); // <--- returns null
String decl = null;
if (encoding.equals("UTF-8")) { // <--- NPE
...
so the XML is not parsed and the hyphenation not done, because the HyphenationTree is empty
Metadata
Metadata
Assignees
Labels
No labels