Skip to content

Commit 3f05017

Browse files
committed
PDFBOX-5660: avoid default encoding
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1927157 13f79535-47bb-0310-9956-ffa450edef68
1 parent 10facb6 commit 3f05017

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.ByteArrayOutputStream;
2323
import java.io.IOException;
2424
import java.io.InputStream;
25+
import java.nio.charset.StandardCharsets;
2526
import java.util.ArrayList;
2627
import java.util.HashSet;
2728
import java.util.List;
@@ -87,7 +88,7 @@ abstract class TrueTypeEmbedder implements Subsetter
8788
InputStream is = ttf.getOriginalData();
8889
byte[] b = new byte[4];
8990
is.mark(b.length);
90-
if (is.read(b) == b.length && new String(b).equals("ttcf"))
91+
if (is.read(b) == b.length && new String(b, StandardCharsets.US_ASCII).equals("ttcf"))
9192
{
9293
is.close();
9394
throw new IOException("Full embedding of TrueType font collections not supported");

0 commit comments

Comments
 (0)