gnujpdf - use UTF-8 in string.getBytes() everywhere

This commit is contained in:
Jindra Petřík
2022-10-22 21:15:20 +02:00
parent ef2ccab594
commit 31a461ca96
19 changed files with 304 additions and 305 deletions

View File

@@ -25,7 +25,7 @@ public class PDFGradientFunction3 extends PDFObject {
@Override
public void write(OutputStream os) throws IOException {
writeStart(os);
os.write(("/FunctionType 3 /Domain [0 1] /Functions [" + String.join(" ", functions2Refs) + "] ").getBytes());
os.write(("/FunctionType 3 /Domain [0 1] /Functions [" + String.join(" ", functions2Refs) + "] ").getBytes("UTF-8"));
int lastcols = fgrad.getColors().length - 1;
List<String> bounds = new ArrayList<>();
List<String> encode = new ArrayList<>();
@@ -35,8 +35,8 @@ public class PDFGradientFunction3 extends PDFObject {
}
encode.add("0 1");
}
os.write(("/Bounds [" + String.join(" ", bounds) + "] ").getBytes());
os.write(("/Encode [" + String.join(" ", encode) + "]\n").getBytes());
os.write(("/Bounds [" + String.join(" ", bounds) + "] ").getBytes("UTF-8"));
os.write(("/Encode [" + String.join(" ", encode) + "]\n").getBytes("UTF-8"));
writeEnd(os);
}