首页 > 其他 > 详细

字符编码问题

时间:2015-04-03 16:57:07      阅读:118      评论:0      收藏:0      [点我收藏+]

UTF-8  GBK 是中文字符 二进制 存储层面的问题

url-encode   / http层 应用层,在浏览器与服务端交互时需考虑;在服务器与服务器时则不要考虑;

浏览器使用$.ajax()发送中文字符时,处理过程:中文字符--->对应的字符编码表示----> 进行urlencode

 

 public static void main(String[] args) throws Exception{

	   String strTest = "中文";
	   strTest = URLEncoder.encode(strTest, "UTF-8");
	   System.out.println(strTest);
	   strTest = URLDecoder.decode(strTest,"UTF-8");
	   System.out.println(strTest);
 }

  

字符编码问题

原文:http://www.cnblogs.com/majia1949/p/4390378.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!