pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1675424 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
Date Wed, 22 Apr 2015 17:14:00 GMT
Author: tilman
Date: Wed Apr 22 17:13:59 2015
New Revision: 1675424

URL: http://svn.apache.org/r1675424
Log:
PDFBOX-2576: use global charsets

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java?rev=1675424&r1=1675423&r2=1675424&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/ContentStreamWriter.java
Wed Apr 22 17:13:59 2015
@@ -30,8 +30,8 @@ import org.apache.pdfbox.cos.COSFloat;
 import org.apache.pdfbox.cos.COSInteger;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSString;
-
 import org.apache.pdfbox.contentstream.operator.Operator;
+import org.apache.pdfbox.util.Charsets;
 
 /**
  * A class that will take a list of tokens and write out a stream with them.
@@ -137,7 +137,7 @@ public class ContentStreamWriter
             Operator op = (Operator)o;
             if( op.getName().equals( "BI" ) )
             {
-                output.write( "BI".getBytes("ISO-8859-1") );
+                output.write( "BI".getBytes(Charsets.ISO_8859_1) );
                 COSDictionary dic = op.getImageParameters();
                 for( COSName key : dic.keySet() )
                 {
@@ -147,16 +147,16 @@ public class ContentStreamWriter
                     writeObject( value );
                     output.write( EOL );
                 }
-                output.write( "ID".getBytes("ISO-8859-1") );
+                output.write( "ID".getBytes(Charsets.ISO_8859_1) );
                 output.write( EOL );
                 output.write( op.getImageData() );
                 output.write( EOL );
-                output.write( "EI".getBytes("ISO-8859-1") );
+                output.write( "EI".getBytes(Charsets.ISO_8859_1) );
                 output.write( EOL );
             }
             else
             {
-                output.write( op.getName().getBytes("ISO-8859-1") );
+                output.write( op.getName().getBytes(Charsets.ISO_8859_1) );
                 output.write( EOL );
             }
         }



Mime
View raw message