Skip to content

Commit

Permalink
Merge pull request #371 from angrykid12/fix-#982
Browse files Browse the repository at this point in the history
Fix #982, add Warning for file in #785
  • Loading branch information
carlwilson authored Apr 9, 2019
2 parents 6cad27b + 8cf5ed7 commit a6d05a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
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

0 comments on commit a6d05a9

Please sign in to comment.