/*
 * Java core library component.
 *
 * Copyright (c) 1997, 1998
 *      Transvirtual Technologies, Inc.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file.
 */

package kaffe.io;
import java.util.Hashtable;

/**
 * Some encodings can be accessed under different names.
 * This class allows us to find an alternate encoding which we support.
 *
 * @author Godmar Back <gback@cs.utah.edu>
 */
public class ConverterAlias {
    private static final Hashtable alias = new Hashtable();

    // All aliases should be upper case
    static {
	alias.put("DEFAULT",		"Default");
	alias.put("ISO-8859-1", 	"8859_1");
	alias.put("ISO_8859_1",		"8859_1");
	alias.put("ISO 8859-1",		"8859_1");
	alias.put("ISO 8859_1",		"8859_1");
	alias.put("ISO8859_1",		"8859_1");
	alias.put("LATIN1",	 	"8859_1");
	alias.put("IBM819",	 	"8859_1");
	alias.put("CP819",	 	"8859_1");
	alias.put("ISO-8859-2",		"8859_2");
	alias.put("ISO-8859-3",		"8859_3");
	alias.put("ISO-8859-4",		"8859_4");
	alias.put("ISO-8859-5",		"8859_5");
	alias.put("ISO-8859-6",		"8859_6");
	alias.put("ISO-8859-7",		"8859_7");
	alias.put("ISO-8859-8",		"8859_8");
	alias.put("ISO-8859-9",		"8859_9");
	alias.put("ISO-2022-JP",	"EUC_JP");
	alias.put("EBCDIC",		"CP1046");
	alias.put("UTF-8",		"UTF8");
	alias.put("KOI8-R",		"KOI8_R");
	/* add more here */
    }

    /**
     * Try to look up an alternate encoding for a given encoding name.
     *
     * @param name of the encoding for which an alias is sought.
     * @return alias if found, name if not.
     */
    static String alias(String name) {
	String alternate = (String)alias.get(name.toUpperCase());
	return alternate != null ? alternate : name;
    }
}

@@ -794,22 +794,96 @@
 put(%22ISO
-8859_1
+_8859-1%22,%09%09%228859_1%22);%0A%09alias.put(%22ISO8859_1%22,%09%09%228859_1%22);%0A%09alias.put(%22ISO-IR-100
 %22,%09%09%22885
@@ -915,32 +915,62 @@
 %22,%09 %09%228859_1%22);%0A
+%09alias.put(%22L1%22,%09%09%09%228859_1%22);%0A
 %09alias.put(%22IBM8
@@ -979,32 +979,32 @@
 %22,%09 %09%228859_1%22);%0A
-
 %09alias.put(%22CP81
@@ -1012,32 +1012,69 @@
 %22,%09 %09%228859_1%22);%0A
+%09alias.put(%22CSISOLATIN1%22,%09%228859_1%22);%0A
 %09alias.put(%22ISO-

Add a few more 8859_1 aliases.