日期:2014-05-16  浏览次数:20868 次

apache.commons.lang2.3学习笔记-CharEncoding

public class TestCharEncoding {

	public void test() {
		/** 字符集常量 */
		//		CharEncoding.ISO_8859_1 = "ISO-8859-1";
		//		CharEncoding.US_ASCII = "US-ASCII";
		//		CharEncoding.UTF_16 = "UTF-16";
		//		CharEncoding.UTF_16BE = "UTF-16BE";
		//		CharEncoding.UTF_16LE = "UTF-16LE";
		//		CharEncoding.UTF_8 = "UTF-8";
		/** isSupported:判断给定的字符集名称是否正确 */
		//		boolean b = CharEncoding.isSupported("gbk");//true
		//		boolean b = CharEncoding.isSupported("");//false
		//		boolean b = CharEncoding.isSupported("xxx");//false
		boolean b = CharEncoding.isSupported(null);//false
		System.err.println(b);
	}

	/**
	 * @author cuiweiqing 2011-12-6
	 * @param args
	 */
	public static void main(String[] args) {
		new TestCharEncoding().test();
	}

}
?