Skip to content

Commit 3e48d22

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

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestEmbeddedFiles.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.io.File;
2020
import java.io.IOException;
21+
import java.nio.charset.StandardCharsets;
2122
import java.nio.file.Files;
2223
import java.nio.file.Paths;
2324

@@ -48,7 +49,7 @@ void testEmbeddedFiles() throws IOException
4849
EmbeddedFiles.main(args);
4950
ExtractEmbeddedFiles.main(args);
5051
byte[] bytes = Files.readAllBytes(Paths.get(embeddedFile));
51-
String content = new String(bytes);
52+
String content = new String(bytes, StandardCharsets.US_ASCII);
5253
Assertions.assertEquals("This is the contents of the embedded file", content);
5354
new File(embeddedFile).delete();
5455
new File(outputFile).delete();

0 commit comments

Comments
 (0)