9404803 发表于 2017-1-8 07:44:57

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();
}
}

 
页: [1]
查看完整版本: apache.commons.lang2.3学习笔记-CharEncoding