aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2004-06-22 19:24:32 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2004-06-22 20:24:32 +0100
commiteb8163abfbde8250b9b7450860f06f65356993ca (patch)
tree514e0f3de83f6d83c27fafa56c44486ed2628748 /libjava
parenta91b0033574cf8d647d3dd56708ce3ec787536ba (diff)
downloadgcc-eb8163abfbde8250b9b7450860f06f65356993ca.zip
gcc-eb8163abfbde8250b9b7450860f06f65356993ca.tar.gz
gcc-eb8163abfbde8250b9b7450860f06f65356993ca.tar.bz2
BytesToUnicode.java (getDecoder): Pass original encoding name to iconv.
* gnu/gcj/convert/BytesToUnicode.java (getDecoder): Pass original encoding name to iconv. * gnu/gcj/convert/UnicodeToBytes.java (getEncoder): Likewise. From-SVN: r83512
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/gnu/gcj/convert/BytesToUnicode.java6
-rw-r--r--libjava/gnu/gcj/convert/UnicodeToBytes.java6
3 files changed, 12 insertions, 6 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index d61b10c..a0a8fda 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,11 @@
2004-06-22 Bryce McKinlay <mckinlay@redhat.com>
+ * gnu/gcj/convert/BytesToUnicode.java (getDecoder): Pass original
+ encoding name to iconv.
+ * gnu/gcj/convert/UnicodeToBytes.java (getEncoder): Likewise.
+
+2004-06-22 Bryce McKinlay <mckinlay@redhat.com>
+
PR libgcj/16134:
* gnu/gcj/convert/BytesToUnicode.java (getDecoder): Canonicalize
encoding name before cache lookup. Thanks to Hannes Wallnoefer.
diff --git a/libjava/gnu/gcj/convert/BytesToUnicode.java b/libjava/gnu/gcj/convert/BytesToUnicode.java
index 6dc5bfd..f33720a 100644
--- a/libjava/gnu/gcj/convert/BytesToUnicode.java
+++ b/libjava/gnu/gcj/convert/BytesToUnicode.java
@@ -75,14 +75,14 @@ public abstract class BytesToUnicode extends IOConverter
{
/* First hunt in our cache to see if we have a decoder that is
already allocated. */
- encoding = canonicalize(encoding);
+ String canonicalEncoding = canonicalize(encoding);
synchronized (BytesToUnicode.class)
{
int i;
for (i = 0; i < decoderCache.length; ++i)
{
if (decoderCache[i] != null
- && encoding.equals(decoderCache[i].getName ()))
+ && canonicalEncoding.equals(decoderCache[i].getName ()))
{
BytesToUnicode rv = decoderCache[i];
decoderCache[i] = null;
@@ -92,7 +92,7 @@ public abstract class BytesToUnicode extends IOConverter
}
// It's not in the cache, so now we have to do real work.
- String className = "gnu.gcj.convert.Input_" + encoding;
+ String className = "gnu.gcj.convert.Input_" + canonicalEncoding;
Class decodingClass;
try
{
diff --git a/libjava/gnu/gcj/convert/UnicodeToBytes.java b/libjava/gnu/gcj/convert/UnicodeToBytes.java
index 74600ec..b143258 100644
--- a/libjava/gnu/gcj/convert/UnicodeToBytes.java
+++ b/libjava/gnu/gcj/convert/UnicodeToBytes.java
@@ -73,14 +73,14 @@ public abstract class UnicodeToBytes extends IOConverter
{
/* First hunt in our cache to see if we have a encoder that is
already allocated. */
- encoding = canonicalize(encoding);
+ String canonicalEncoding = canonicalize(encoding);
synchronized (UnicodeToBytes.class)
{
int i;
for (i = 0; i < encoderCache.length; ++i)
{
if (encoderCache[i] != null
- && encoding.equals(encoderCache[i].getName ()))
+ && canonicalEncoding.equals(encoderCache[i].getName ()))
{
UnicodeToBytes rv = encoderCache[i];
encoderCache[i] = null;
@@ -89,7 +89,7 @@ public abstract class UnicodeToBytes extends IOConverter
}
}
- String className = "gnu.gcj.convert.Output_" + encoding;
+ String className = "gnu.gcj.convert.Output_" + canonicalEncoding;
Class encodingClass;
try
{