Skip to content

Commit

Permalink
Ignore invalid utf-8 sequences.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aazhar committed Feb 26, 2019
1 parent c00e89d commit d06fa76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/XmlAltoOutputDev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2835,7 +2835,6 @@ void TextPage::addCharToRawWord(GfxState *state, double x, double y, double dx,
// add the characters to the current word
w1 /= uLen;
h1 /= uLen;

for (i = 0; i < uLen; ++i) {
if (isNonUnicodeGlyph)
curWord->setContainNonUnicodeGlyph(isNonUnicodeGlyph);
Expand Down Expand Up @@ -8333,7 +8332,9 @@ void XmlAltoOutputDev::drawChar(GfxState *state, double x, double y, double dx,
uLen = 1;
isNonUnicodeGlyph = gTrue;
}
}
} else if(uLen > 1 && (globalParams->getTextEncodingName()->cmp(ENCODING_UTF8)==0)&& !isUTF8(u, uLen))
return;

text->addChar(state, x, y, dx, dy, c, nBytes, u, uLen, splashFont, isNonUnicodeGlyph);
}

Expand Down

0 comments on commit d06fa76

Please sign in to comment.