1 /* Copyright (C) 2000 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9 /* This is a base class that handles aliasing issues for
10 UnicodeToBytes to BytesToUnicode. */
12 package gnu.gcj.convert;
14 import java.util.Hashtable;
16 public abstract class IOConverter
18 // Map encoding aliases to our canonical form.
19 static private Hashtable hash = new Hashtable ();
23 // Manually maintained aliases. Note that the value must be our
25 hash.put ("ISO-Latin-1", "8859_1");
26 // All aliases after this point are automatically generated by the
27 // `encodings.pl' script. Run it to make any corrections.
28 hash.put ("ISO_8859-1:1987", "8859_1");
29 hash.put ("iso-ir-100", "8859_1");
30 hash.put ("ISO_8859-1", "8859_1");
31 hash.put ("ISO-8859-1", "8859_1");
32 hash.put ("latin1", "8859_1");
33 hash.put ("l1", "8859_1");
34 hash.put ("IBM819", "8859_1");
35 hash.put ("CP819", "8859_1");
36 hash.put ("csISOLatin1", "8859_1");
37 hash.put ("UTF-8", "UTF8");
38 hash.put ("Shift_JIS", "SJIS");
39 hash.put ("MS_Kanji", "SJIS");
40 hash.put ("csShiftJIS", "SJIS");
41 hash.put ("Extended_UNIX_Code_Packed_Format_for_Japanese", "EUCJIS");
42 hash.put ("csEUCPkdFmtJapanese", "EUCJIS");
43 hash.put ("EUC-JP", "EUCJIS");
46 // Turn an alias into the canonical form.
47 protected static final String canonicalize (String name)
49 String c = (String) hash.get (name);
50 return c == null ? name : c;