You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2007/05/11 09:00:47 UTC

svn commit: r537120 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOURIResolver.java

Author: jeremias
Date: Fri May 11 00:00:46 2007
New Revision: 537120

URL: http://svn.apache.org/viewvc?view=rev&rev=537120
Log:
Fixed default encoding problem.
Submitted by: Jelka Kosir <jelka.kosir.at.atol.si>

Note by jeremias: I haven't found any information which encoding/charset should be used with basic authentication. RFC 2617 doesn't seem to address that. The behaviour for characters outside the US-ASCII (7bit) charset may not be as expected.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOURIResolver.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOURIResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOURIResolver.java?view=diff&rev=537120&r1=537119&r2=537120
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOURIResolver.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOURIResolver.java Fri May 11 00:00:46 2007
@@ -189,10 +189,11 @@
         try {
             ByteArrayOutputStream baout = new ByteArrayOutputStream(combined.length() * 2);
             Base64EncodeStream base64 = new Base64EncodeStream(baout);
-            base64.write(combined.getBytes());
+            //TODO Not sure what charset/encoding can be used with basic authentication
+            base64.write(combined.getBytes("UTF-8"));
             base64.close();
             connection.setRequestProperty("Authorization", 
-                    "Basic " + new String(baout.toByteArray()));
+                    "Basic " + new String(baout.toByteArray(), "UTF-8"));
         } catch (IOException e) {
             //won't happen. We're operating in-memory.
             throw new RuntimeException("Error during base64 encodation of username/password");



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org