Chinaunix首页 | 论坛 | 博客
  • 博客访问: 413284
  • 博文数量: 112
  • 博客积分: 4000
  • 博客等级: 上校
  • 技术积分: 905
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-05 21:14
文章分类

全部博文(112)

文章存档

2009年(3)

2008年(24)

2007年(55)

2006年(30)

我的朋友

分类: Java

2008-04-29 17:11:00

乱码测试,我就不相信没一个被我给逮着的!呵呵!写出来共大家参考!  
 
String name =request.getParameter("name");// ;
 
        System.out.println(name);//1
       System.out.println(name.getBytes());//2
       System.out.println(name.getBytes("utf-8"));//3
       System.out.println(name.getBytes("ISO8859_1"));//4
       System.out.println(new String(name.getBytes()));//5
       System.out.println(new String(name.getBytes(),"utf-8"));//6
       System.out.println(new String(name.getBytes(),"ISO8859_1"));//7
       System.out.println(new String(name.getBytes("utf-8")));//8
       System.out.println(new String(name.getBytes("utf-8"),"utf-8"));//9
       System.out.println(new String(name.getBytes("utf-8"),"ISO8859_1"));//10
       System.out.println(new String(name.getBytes("ISO8859_1")));//11
       System.out.println(new String(name.getBytes("ISO8859_1"),"utf-8"));//12
       System.out.println(new String(name.getBytes("ISO8859_1"),"ISO8859_1"));//13
 System.out.println("****************************************************************");//1
       System.out.println(name.getBytes());//2
       System.out.println(name.getBytes("GB2312"));//3
       System.out.println(name.getBytes("ISO8859_1"));//4
       System.out.println(new String(name.getBytes()));//5
       System.out.println(new String(name.getBytes(),"GB2312"));//6
       System.out.println(new String(name.getBytes(),"ISO8859_1"));//7
       System.out.println(new String(name.getBytes("GB2312")));//8
       System.out.println(new String(name.getBytes("GB2312"),"GB2312"));//9
       System.out.println(new String(name.getBytes("GB2312"),"ISO8859_1"));//10
       System.out.println(new String(name.getBytes("ISO8859_1")));//11
       System.out.println(new String(name.getBytes("ISO8859_1"),"GB2312"));//12
       System.out.println(new String(name.getBytes("ISO8859_1"),"ISO8859_1"));//13
阅读(1345) | 评论(0) | 转发(0) |
0

上一篇:Log4j配置

下一篇:Java集合类(整理)

给主人留下些什么吧!~~