aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-05-11 07:00:46 +0000
committerJeremias Maerki <jeremias@apache.org>2007-05-11 07:00:46 +0000
commitb2fd48501bf49caef7f721944484dfe3bad2387f (patch)
tree13d55c21fc3ce5b831e6824e1d36d732501cec08 /src
parent02bb4b460f40a45448895c41a5b35bfc0d00ecdd (diff)
downloadxmlgraphics-fop-b2fd48501bf49caef7f721944484dfe3bad2387f.tar.gz
xmlgraphics-fop-b2fd48501bf49caef7f721944484dfe3bad2387f.zip
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. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@537120 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/apps/FOURIResolver.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/apps/FOURIResolver.java b/src/java/org/apache/fop/apps/FOURIResolver.java
index 5b66ffa57..e3ffd22cc 100644
--- a/src/java/org/apache/fop/apps/FOURIResolver.java
+++ b/src/java/org/apache/fop/apps/FOURIResolver.java
@@ -189,10 +189,11 @@ public class FOURIResolver
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");