1 18 package org.apache.batik.util; 19 20 import java.util.HashMap ; 21 import java.util.Map ; 22 23 29 public class EncodingUtilities { 30 31 34 protected final static Map ENCODINGS = new HashMap (); 35 static { 36 ENCODINGS.put("UTF-8", "UTF8"); 37 ENCODINGS.put("UTF-16", "Unicode"); 38 ENCODINGS.put("US-ASCII", "ASCII"); 39 40 ENCODINGS.put("ISO-8859-1", "8859_1"); 41 ENCODINGS.put("ISO-8859-2", "8859_2"); 42 ENCODINGS.put("ISO-8859-3", "8859_3"); 43 ENCODINGS.put("ISO-8859-4", "8859_4"); 44 ENCODINGS.put("ISO-8859-5", "8859_5"); 45 ENCODINGS.put("ISO-8859-6", "8859_6"); 46 ENCODINGS.put("ISO-8859-7", "8859_7"); 47 ENCODINGS.put("ISO-8859-8", "8859_8"); 48 ENCODINGS.put("ISO-8859-9", "8859_9"); 49 ENCODINGS.put("ISO-2022-JP", "JIS"); 50 51 ENCODINGS.put("WINDOWS-31J", "MS932"); 52 ENCODINGS.put("EUC-JP", "EUCJIS"); 53 ENCODINGS.put("GB2312", "GB2312"); 54 ENCODINGS.put("BIG5", "Big5"); 55 ENCODINGS.put("EUC-KR", "KSC5601"); 56 ENCODINGS.put("ISO-2022-KR", "ISO2022KR"); 57 ENCODINGS.put("KOI8-R", "KOI8_R"); 58 59 ENCODINGS.put("EBCDIC-CP-US", "Cp037"); 60 ENCODINGS.put("EBCDIC-CP-CA", "Cp037"); 61 ENCODINGS.put("EBCDIC-CP-NL", "Cp037"); 62 ENCODINGS.put("EBCDIC-CP-WT", "Cp037"); 63 ENCODINGS.put("EBCDIC-CP-DK", "Cp277"); 64 ENCODINGS.put("EBCDIC-CP-NO", "Cp277"); 65 ENCODINGS.put("EBCDIC-CP-FI", "Cp278"); 66 ENCODINGS.put("EBCDIC-CP-SE", "Cp278"); 67 ENCODINGS.put("EBCDIC-CP-IT", "Cp280"); 68 ENCODINGS.put("EBCDIC-CP-ES", "Cp284"); 69 ENCODINGS.put("EBCDIC-CP-GB", "Cp285"); 70 ENCODINGS.put("EBCDIC-CP-FR", "Cp297"); 71 ENCODINGS.put("EBCDIC-CP-AR1", "Cp420"); 72 ENCODINGS.put("EBCDIC-CP-HE", "Cp424"); 73 ENCODINGS.put("EBCDIC-CP-BE", "Cp500"); 74 ENCODINGS.put("EBCDIC-CP-CH", "Cp500"); 75 ENCODINGS.put("EBCDIC-CP-ROECE", "Cp870"); 76 ENCODINGS.put("EBCDIC-CP-YU", "Cp870"); 77 ENCODINGS.put("EBCDIC-CP-IS", "Cp871"); 78 ENCODINGS.put("EBCDIC-CP-AR2", "Cp918"); 79 80 ENCODINGS.put("CP1252", "Cp1252"); 81 } 82 83 86 protected EncodingUtilities() { 87 } 88 89 94 public static String javaEncoding(String encoding) { 95 return (String )ENCODINGS.get(encoding.toUpperCase()); 96 } 97 } 98 | Popular Tags |