javascript 的 Encode,Javascript,escape,encodeURI,encodeURIComponent,UTF-8
Posted on 2009-08-13 11:02 子游 阅读(329) 评论(0) 收藏 举报
点滴积累
如果要在网页直接传递中文字符,通过Request获取,首页是Utf-8,而接受页面时gb2312
这样在接收的页面通过request获取就会出现乱码
例如:http://localhost/default.aspx?username=子游
用户可以通过encodeURIComponent(), encodeURI() 来处理
例如 http://localhost/default.aspx?username=encodeURIComponent(子游)
这样就不会出现问题了。
于 北京
如果要在网页直接传递中文字符,通过Request获取,首页是Utf-8,而接受页面时gb2312
这样在接收的页面通过request获取就会出现乱码
例如:http://localhost/default.aspx?username=子游
用户可以通过encodeURIComponent(), encodeURI() 来处理
例如 http://localhost/default.aspx?username=encodeURIComponent(子游)
这样就不会出现问题了。
于 北京
互动营销专家(邮件营销,在线调查,事件营销)
http://www.supermore.com.cn