diff options
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/classpath/lib/gnu/gcj/convert/Convert.class | bin | 5087 -> 4799 bytes | |||
-rw-r--r-- | libjava/gnu/gcj/convert/Convert.java | 16 |
3 files changed, 13 insertions, 9 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 37d61bcbb29..142d36da577 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2007-01-25 Tom Tromey <tromey@redhat.com> + + PR libgcj/29594: + * gnu/gcj/convert/Convert.java (main): Correctly handle missing + input or output encodings. Removed unused local variables. + 2007-01-25 Keith Seitz <keiths@redhat.com> * include/jvmti-int.h (_Jv_GetJDWP_JVMTIEnv): Declare. diff --git a/libjava/classpath/lib/gnu/gcj/convert/Convert.class b/libjava/classpath/lib/gnu/gcj/convert/Convert.class Binary files differindex baff2de415f..898b4bb29ca 100644 --- a/libjava/classpath/lib/gnu/gcj/convert/Convert.class +++ b/libjava/classpath/lib/gnu/gcj/convert/Convert.class diff --git a/libjava/gnu/gcj/convert/Convert.java b/libjava/gnu/gcj/convert/Convert.java index afeac649248..cf67061d6b7 100644 --- a/libjava/gnu/gcj/convert/Convert.java +++ b/libjava/gnu/gcj/convert/Convert.java @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2002, 2005, 2006 Free Software Foundation +/* Copyright (C) 1999, 2002, 2005, 2006, 2007 Free Software Foundation This file is part of libgcj. @@ -151,12 +151,6 @@ public class Convert try { - BytesToUnicode inDecoder - = inEncodingName == null ? BytesToUnicode.getDefaultDecoder() - : BytesToUnicode.getDecoder(inEncodingName); - UnicodeToBytes outEncoder - = outEncodingName == null ? UnicodeToBytes.getDefaultEncoder() - : UnicodeToBytes.getEncoder(outEncodingName); InputStream inStream = inName.equals("-") ? System.in : new FileInputStream(inName); OutputStream outStream; @@ -165,9 +159,13 @@ public class Convert else outStream = new FileOutputStream(outName); InputStreamReader in - = new InputStreamReader(inStream, inEncodingName); + = (inEncodingName == null + ? new InputStreamReader(inStream) + : new InputStreamReader(inStream, inEncodingName)); OutputStreamWriter out - = new OutputStreamWriter(outStream, outEncodingName); + = (outEncodingName == null + ? new OutputStreamWriter(outStream) + : new OutputStreamWriter(outStream, outEncodingName)); char[] buffer = new char[2048]; for (;;) { |