1 16 17 package org.apache.commons.lang; 18 19 import java.io.UnsupportedEncodingException ; 20 21 41 public class CharEncoding { 42 43 54 public static final String ISO_8859_1 = "ISO-8859-1"; 55 56 67 public static final String US_ASCII = "US-ASCII"; 68 69 81 public static final String UTF_16 = "UTF-16"; 82 83 94 public static final String UTF_16BE = "UTF-16BE"; 95 96 107 public static final String UTF_16LE = "UTF-16LE"; 108 109 120 public static final String UTF_8 = "UTF-8"; 121 122 140 public static boolean isSupported(String name) { 141 if (name == null) { 142 return false; 143 } 144 try { 145 new String (ArrayUtils.EMPTY_BYTE_ARRAY, name); 146 } catch (UnsupportedEncodingException e) { 147 return false; 148 } 149 return true; 150 } 151 152 } 153 | Popular Tags |