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

@@ -117,12 +117,12 @@ public abstract class PDFObject implements Serializable {
* @exception IOException on error
*/
public final void writeStart(OutputStream os) throws IOException {
os.write(Integer.toString(objser).getBytes());
os.write(" 0 obj\n<<\n".getBytes());
os.write(Integer.toString(objser).getBytes("UTF-8"));
os.write(" 0 obj\n<<\n".getBytes("UTF-8"));
if (type != null) {
os.write("/Type ".getBytes());
os.write(type.getBytes());
os.write("\n".getBytes());
os.write("/Type ".getBytes("UTF-8"));
os.write(type.getBytes("UTF-8"));
os.write("\n".getBytes("UTF-8"));
}
}
@@ -137,7 +137,7 @@ public abstract class PDFObject implements Serializable {
* @exception IOException on error
*/
public final void writeEnd(OutputStream os) throws IOException {
os.write(">>\nendobj\n".getBytes());
os.write(">>\nendobj\n".getBytes("UTF-8"));
}
/**