summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-11-08 16:54:19 +0000
committerMark Wielaard <mark@klomp.org>2006-11-08 16:54:19 +0000
commitf52bc106c721f27be3108f2e997071fce6604b4a (patch)
treedbd838a3b9a2bf164523f87cc52ee723986c1b77 /java
parentc9a396d23cd00029f590fcbc19820b4f80a11bc8 (diff)
downloadclasspath-f52bc106c721f27be3108f2e997071fce6604b4a.tar.gz
Fixes bug #29754
* java/io/OutputStreamWriter.java (OutputStreamWriter(OutputStream,Charset)): Set encodingName. (OutputStreamWriter(OutputStream,CharsetEncoder)): Likewise.
Diffstat (limited to 'java')
-rw-r--r--java/io/OutputStreamWriter.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/java/io/OutputStreamWriter.java b/java/io/OutputStreamWriter.java
index 572683834..26363401f 100644
--- a/java/io/OutputStreamWriter.java
+++ b/java/io/OutputStreamWriter.java
@@ -223,6 +223,7 @@ public class OutputStreamWriter extends Writer
encoder.onMalformedInput(CodingErrorAction.REPLACE);
encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
outputBuffer = CharBuffer.allocate(BUFFER_SIZE);
+ encodingName = EncodingHelper.getOldCanonical(cs.name());
}
/**
@@ -240,6 +241,11 @@ public class OutputStreamWriter extends Writer
this.out = out;
encoder = enc;
outputBuffer = CharBuffer.allocate(BUFFER_SIZE);
+ Charset cs = enc.charset();
+ if (cs == null)
+ encodingName = "US-ASCII";
+ else
+ encodingName = EncodingHelper.getOldCanonical(cs.name());
}
/**