现在的位置: 首页 > 综合 > 正文

字符集与字符编码

2012年05月04日 ⁄ 综合 ⁄ 共 272字 ⁄ 字号 评论关闭
String input="我爱北京天啊们";
        byte[] l0=input.getBytes(Charset.defaultCharset());
        byte[] l1=input.getBytes(Charset.forName("UTF-8"));
        byte[] l2=input.getBytes(Charset.forName("GBK"));
        
        
        
        System.out.println(l1);
        System.out.println(l2);

转载自:http://blog.csdn.net/cc_net/article/details/2896317







 

抱歉!评论已关闭.