summaryrefslogtreecommitdiff
path: root/libjava/gnu/gcj/convert/IOConverter.java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-01 17:00:02 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-01 17:00:02 +0000
commit3b653a71f8a9df17ca147173a6ecae85a4b561e3 (patch)
treeeb0fff5301aba42e99bf81089d2c71311deab8ad /libjava/gnu/gcj/convert/IOConverter.java
parent45c904cd51b265948e43d575055347dadc8b18cf (diff)
downloadgcc-3b653a71f8a9df17ca147173a6ecae85a4b561e3.tar.gz
* scripts/encodings.pl: Added `ASCII' alias.
* Makefile.in: Rebuilt. * Makefile.am (convert_source_files): Added new files. * gnu/gcj/convert/Input_ASCII.java: New file. * gnu/gcj/convert/Output_ASCII.java: New file. * gnu/gcj/convert/Output_8859_1.java (write): Use `?' to represent out-of-range characters. * gnu/gcj/convert/natIconv.cc (iconv_init): New method. (read): Swap bytes if required. Treat `count' as character count, not byte count. (write): Likewise. Also, handle case where iconv fails on a given character. (init): Put encoding into exception. * gnu/gcj/convert/IOConverter.java (iconv_byte_swap): New global. (static): Call iconv_init. Rebuilt alias list. (iconv_init): New private method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37190 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/gcj/convert/IOConverter.java')
-rw-r--r--libjava/gnu/gcj/convert/IOConverter.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/libjava/gnu/gcj/convert/IOConverter.java b/libjava/gnu/gcj/convert/IOConverter.java
index c98662485b6..9b5fbad00f4 100644
--- a/libjava/gnu/gcj/convert/IOConverter.java
+++ b/libjava/gnu/gcj/convert/IOConverter.java
@@ -18,6 +18,10 @@ public abstract class IOConverter
// Map encoding aliases to our canonical form.
static private Hashtable hash = new Hashtable ();
+ // True if we have to do byte-order conversions on iconv()
+ // arguments.
+ static protected boolean iconv_byte_swap;
+
static
{
// Manually maintained aliases. Note that the value must be our
@@ -25,6 +29,17 @@ public abstract class IOConverter
hash.put ("ISO-Latin-1", "8859_1");
// All aliases after this point are automatically generated by the
// `encodings.pl' script. Run it to make any corrections.
+ hash.put ("ANSI_X3.4-1968", "ASCII");
+ hash.put ("iso-ir-6", "ASCII");
+ hash.put ("ANSI_X3.4-1986", "ASCII");
+ hash.put ("ISO_646.irv:1991", "ASCII");
+ hash.put ("ASCII", "ASCII");
+ hash.put ("ISO646-US", "ASCII");
+ hash.put ("US-ASCII", "ASCII");
+ hash.put ("us", "ASCII");
+ hash.put ("IBM367", "ASCII");
+ hash.put ("cp367", "ASCII");
+ hash.put ("csASCII", "ASCII");
hash.put ("ISO_8859-1:1987", "8859_1");
hash.put ("iso-ir-100", "8859_1");
hash.put ("ISO_8859-1", "8859_1");
@@ -41,8 +56,12 @@ public abstract class IOConverter
hash.put ("Extended_UNIX_Code_Packed_Format_for_Japanese", "EUCJIS");
hash.put ("csEUCPkdFmtJapanese", "EUCJIS");
hash.put ("EUC-JP", "EUCJIS");
+
+ iconv_byte_swap = iconv_init ();
}
+ private static native boolean iconv_init ();
+
// Turn an alias into the canonical form.
protected static final String canonicalize (String name)
{