aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/pdf/PDFDocument.java6
-rw-r--r--src/java/org/apache/fop/pdf/PDFRectangle.java2
-rw-r--r--src/java/org/apache/fop/pdf/PDFStream.java2
-rw-r--r--status.xml3
4 files changed, 8 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFDocument.java b/src/java/org/apache/fop/pdf/PDFDocument.java
index 29cb88731..00d6c8e08 100644
--- a/src/java/org/apache/fop/pdf/PDFDocument.java
+++ b/src/java/org/apache/fop/pdf/PDFDocument.java
@@ -934,7 +934,7 @@ public class PDFDocument {
getProfile().verifyPDFVersion();
- byte[] pdf = ("%PDF-" + getPDFVersionString() + "\n").getBytes();
+ byte[] pdf = encode("%PDF-" + getPDFVersionString() + "\n");
stream.write(pdf);
this.position += pdf.length;
@@ -955,9 +955,9 @@ public class PDFDocument {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
DateFormat df = new SimpleDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS");
- digest.update(df.format(new Date()).getBytes());
+ digest.update(encode(df.format(new Date())));
//Ignoring the filename here for simplicity even though it's recommended by the PDF spec
- digest.update(String.valueOf(this.position).getBytes());
+ digest.update(encode(String.valueOf(this.position)));
digest.update(getInfo().toPDF());
byte[] res = digest.digest();
String s = PDFText.toHex(res);
diff --git a/src/java/org/apache/fop/pdf/PDFRectangle.java b/src/java/org/apache/fop/pdf/PDFRectangle.java
index def6d9a2b..e84227adf 100644
--- a/src/java/org/apache/fop/pdf/PDFRectangle.java
+++ b/src/java/org/apache/fop/pdf/PDFRectangle.java
@@ -79,7 +79,7 @@ public class PDFRectangle {
* @return the PDF
*/
public byte[] toPDF() {
- return toPDFString().getBytes();
+ return PDFDocument.encode(toPDFString());
}
/**
diff --git a/src/java/org/apache/fop/pdf/PDFStream.java b/src/java/org/apache/fop/pdf/PDFStream.java
index ea7748576..2cc9a1b0a 100644
--- a/src/java/org/apache/fop/pdf/PDFStream.java
+++ b/src/java/org/apache/fop/pdf/PDFStream.java
@@ -57,7 +57,7 @@ public class PDFStream extends AbstractPDFStream {
*/
public void add(String s) {
try {
- data.getOutputStream().write(s.getBytes());
+ data.getOutputStream().write(PDFDocument.encode(s));
} catch (IOException ex) {
//TODO throw the exception and catch it elsewhere
ex.printStackTrace();
diff --git a/status.xml b/status.xml
index 1570630a3..37f0f53f9 100644
--- a/status.xml
+++ b/status.xml
@@ -28,6 +28,9 @@
<changes>
<release version="FOP Trunk">
+ <action context="Code" dev="JM" type="fix" fixes-bug="41434" due-to="Martin Kögler">
+ Fix PDF Genaration for non-ASCII compatible locales.
+ </action>
<action context="Code" dev="VH, JM" type="add" importance="high" fixes-bug="36934">
Add support for the collapsing-border model in tables.
</action>