<script>
str = encodeURI("中文");
decodeStr = decodeURI(str)
alert(str+"->"+decodeStr)
</script>
str = encodeURI("中文");
decodeStr = decodeURI(str)
alert(str+"->"+decodeStr)
</script>
解决方案 »
- jackson小问题
- 主窗口中打开新页面并隐藏工具栏
- 请问用css翻转图标
- 我用IFRAME做了一个HTML编辑器,请问如何让右键出来的是复制、拷贝粘贴的那个菜单?
- ext grid checkbox不能重选
- 提交页面之后,谷歌和火狐浏览器就一直提示在处理; ie浏览器却可以提交?
- 请求jquery的bxSlider插件问题
- Vml:Textpath元素,如何设置string 的对齐方式?
- 我想让主页跳出一个窗口,并保持着一个(when refesh),能不能给我code ?csdn不能搜索了,谢谢大家
- 送分问题:我想实现单击一个单选按钮就使被disabled的3个文本框可用该怎么做啊
- 怎样交一幅图片拖进表格中
- 如何判断对象是否存在?
str = encodeURI("中文");
decodeStr = decodeURI(str)
alert(str+"->"+decodeStr)
</script>
转化的结果和页面post过去截获的数据不一样
比如"中国人",decode的结果是"%E4%B8%AD%E5%9B%BD%E4%BA%BA",但实际结果是"%D6%D0%B9%FA%C8%CB",一般来说,一个汉字包含两个编码,所以应该是6个编码,形如D6%D0%B9%FA%C8%CB"是正确的。请问唠叨兄,你是如何得到"%b4%c3" 是汉字“疵”?有什么函数?
<input name=postinfo value=中国人>
<input type=submit>
</form>奇怪了,看我的页面,故意弄出错看 post 数据,这是 customerinfo.asp 的反馈:========
技术信息(用于支持人员)错误类型:
Microsoft JScript 运行时错误 (0x800A138F)
缺少对象
/test/sale/customerinfo.asp, 第 14 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705) 网页:
POST 29 ??? /test/sale/customerinfo.aspPOST Data:
postinfo=%E4%B8%AD%E5%9B%BD%E4%BA%BA 时间:
2003年6月19日, 13:22:31
char tt[20];
tt[0] = 0XD6;
tt[1] = 0XD0;
tt[2] = 0XB9;
tt[3] = 0XFA;
tt[4] = 0XC8;
tt[5] = 0XCB;
ShowMessage(tt);
得到的结果就是“中国人”。
问题就复杂了。
到底"%E4%B8%AD%E5%9B%BD%E4%BA%BA"和"%D6%D0%B9%FA%C8%CB"各是通过那种编码传输的?
什么时候会采用何种编码传输?
和header区中的<meta ...charset=gb2312/UTF-8>有关系吗?
哪位兄弟能给我解答,感激不尽!