System.out.println("1:"+msg);
System.out.println("2:"+new String(msg.getBytes()));
System.out.println("31:"+new String(msg.getBytes(),"GBK"));
System.out.println("32:"+new String(msg.getBytes(),"GB2312"));
System.out.println("4:"+new String(msg.getBytes(),"UTF8"));
System.out.println("5:"+new String(msg.getBytes(),"ISO-8859-1"));
System.out.println("6:"+new String(msg.getBytes("GB2312")));
System.out.println("7:"+new String(msg.getBytes("GB2312"),"utf8"));
System.out.println("8:"+new String(msg.getBytes("GB2312"),"GBK"));
System.out.println("9:"+new String(msg.getBytes("GB2312"),"ISO-8859-1"));
System.out.println("10:"+new String(msg.getBytes("ISO-8859-1")));
System.out.println("11:"+new String(msg.getBytes("ISO-8859-1"),"GB2312"));
System.out.println("12:"+new String(msg.getBytes("iso-8859-1"),"gbk"));
System.out.println("13:"+new String(msg.getBytes("iso-8859-1"),"utf8"));
System.out.println("14:"+new String(msg.getBytes("utf-8")));
System.out.println("15:"+new String(msg.getBytes("UTF-8"),"GBK"));
System.out.println("16:"+new String(msg.getBytes("utf-8"),"gb2312"));
System.out.println("17:"+new String(msg.getBytes("UTF-8"),"ISO-8859-1"));
System.out.println("18:"+new String(msg.getBytes("GBK")));
System.out.println("19:"+new String(msg.getBytes("GBK"),"utf8"));
System.out.println("20:"+new String(msg.getBytes("GBK"),"GB2312"));
System.out.println("21:"+new String(msg.getBytes("GBK"),"ISO-8859-1"));---==1:?? ??? ???????
2:?? ??? ???????
31:?? ??? ???????
32:?? ??? ???????
4:?? ??? ???????
5:?? ??? ???????
6:?? ??? ???????
7:?? ??? ???????
8:?? ??? ???????
9:?? ??? ???????
10:?? ??? ???????
11:?? ??? ???????
12:?? ??? ???????
13:?? ??? ???????
14:锟斤拷 锟斤拷锟? 说锟斤拷????
15:锟斤拷 锟斤拷锟? 说锟斤拷????
16:锟斤拷 锟斤拷锟? 说锟斤拷????
17:?????? ????????? ????????????
18:?? ??? ???????
19:?? ??? ???????
20:?? ??? ???????
21:?? ??? ???????
System.out.println("2:"+new String(msg.getBytes()));
System.out.println("31:"+new String(msg.getBytes(),"GBK"));
System.out.println("32:"+new String(msg.getBytes(),"GB2312"));
System.out.println("4:"+new String(msg.getBytes(),"UTF8"));
System.out.println("5:"+new String(msg.getBytes(),"ISO-8859-1"));
System.out.println("6:"+new String(msg.getBytes("GB2312")));
System.out.println("7:"+new String(msg.getBytes("GB2312"),"utf8"));
System.out.println("8:"+new String(msg.getBytes("GB2312"),"GBK"));
System.out.println("9:"+new String(msg.getBytes("GB2312"),"ISO-8859-1"));
System.out.println("10:"+new String(msg.getBytes("ISO-8859-1")));
System.out.println("11:"+new String(msg.getBytes("ISO-8859-1"),"GB2312"));
System.out.println("12:"+new String(msg.getBytes("iso-8859-1"),"gbk"));
System.out.println("13:"+new String(msg.getBytes("iso-8859-1"),"utf8"));
System.out.println("14:"+new String(msg.getBytes("utf-8")));
System.out.println("15:"+new String(msg.getBytes("UTF-8"),"GBK"));
System.out.println("16:"+new String(msg.getBytes("utf-8"),"gb2312"));
System.out.println("17:"+new String(msg.getBytes("UTF-8"),"ISO-8859-1"));
System.out.println("18:"+new String(msg.getBytes("GBK")));
System.out.println("19:"+new String(msg.getBytes("GBK"),"utf8"));
System.out.println("20:"+new String(msg.getBytes("GBK"),"GB2312"));
System.out.println("21:"+new String(msg.getBytes("GBK"),"ISO-8859-1"));---==1:?? ??? ???????
2:?? ??? ???????
31:?? ??? ???????
32:?? ??? ???????
4:?? ??? ???????
5:?? ??? ???????
6:?? ??? ???????
7:?? ??? ???????
8:?? ??? ???????
9:?? ??? ???????
10:?? ??? ???????
11:?? ??? ???????
12:?? ??? ???????
13:?? ??? ???????
14:锟斤拷 锟斤拷锟? 说锟斤拷????
15:锟斤拷 锟斤拷锟? 说锟斤拷????
16:锟斤拷 锟斤拷锟? 说锟斤拷????
17:?????? ????????? ????????????
18:?? ??? ???????
19:?? ??? ???????
20:?? ??? ???????
21:?? ??? ???????
解决方案 »
- 大家分析一下一个数据库连接不释放的所占用内存是怎么的
- 请问 西安 Java web开发 2年工作经验的,什么待遇啊,大概会有多少钱?
- jsp菜鸟级问题,急,在线等
- The value for the useBean class attribute checkLogin is invalid! 这个是什么错误?分不够再加!
- 服务器实时监控网页的实现....
- Tomcat在Eclipse中成功启动,主页却打不开 ,看不到猫页面
- xfire 窄接口方式实现的客户端、偶尔报错,请指教
- 本人想学jsp,想问几个关键的问题
- 急!在线等待!我在运行程序的时候出现如下错误信息:StandardHost[localhost]: MAPPING configuration error for request URI,为什么?
- 关于jsp传递html链接中文参数的问题?已经翻了很多贴子,都不行,再线等?急!
- 看看我这个问题出在哪?
- serverlet 加 applet 分组通讯,怎样实现serverlet只发送数据到特定几个客户端的APPLET
举个例子吧:
假如你在jsp中这样做pageEncoding="ISO-8859-1",那么你的浏览器会以ISO-8859-1方式解码,如果你传过来的是GBK编码的数据时,自然要出现乱码.如果你不指定,浏览器会自己根据你的系统本地信息自动为你选默认编码方式来解码(一般简体中文的操作系统默认编码是gb18030,繁体中文可能就是Big5了).当然造成乱码的原因很多,这只是举个最简单的例子,我不知道你的具体原因,所以爱莫能助