Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #982, add Warning for file in #785 #371

Merged
merged 2 commits into from
Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/verapdf/pd/font/cmap/CMapParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private static long getBfrangeEndFromBytes(byte[] endRange, byte[] beginRange) {
byte endRangeByte = endRange[i];
byte beginRangeByte = beginRange[i];
if (endRangeByte != beginRangeByte) {
LOGGER.log(Level.FINE, "Incorrect bfrange in toUnicode CMap: " +
LOGGER.log(Level.WARNING, "Incorrect bfrange in toUnicode CMap: " +
"bfrange contains more than 256 code.");
}
res += (beginRangeByte & 0x00FF) << ((endRange.length - i - 1) * 8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ private static String getUnicodeNameFromLong(byte[] unicode) {
return fffe;
}
try {
if (unicode[0] == 0) {
return String.valueOf((char)unicode[1]);
}
return new String(unicode, "UTF-16BE");
return (unicode[0] == 0) ? String.valueOf(unicode[1]) : new String(unicode, "UTF-16BE");
} catch (UnsupportedEncodingException e) {
LOGGER.log(Level.FINE, "Can't find String encoding UTF-16BE", e);
return null; // I'm sure this won't be reached
Expand Down