日期:2014-05-20 浏览次数:20670 次
import java.nio.charset.Charset; public class CharsetTest { public static void main(String[] args) { System.out.println(Charset.isSupported("GBK")); System.out.println(Charset.isSupported("utf-8")); System.out.println(Charset.isSupported("iso-8859-1")); System.out.println(Charset.isSupported("hello")); System.out.println(Charset.isSupported("gbK")); System.out.println(Charset.isSupported("gbk")); System.out.println(Charset.isSupported("GB18030")); } }
------解决方案--------------------
boolean flag = CharSet.isSupported("GBK")