url字符串编码乱码问题
来源:互联网 发布:金税通网络电子发票 编辑:程序博客网 时间:2024/05/02 04:46
function webChart() { var t = document.getElementById("txtReceive"); if (t.value == null || t.value == "") { alert("请先进行查询"); } else { alert(t.value); document.getElementById("center-iframe").src = "map/industryMap.aspx?_indeustry=" + t.value;}}
这个时候alert出来的编码很正常,都是汉字。
但是在后台获取时已经乱码
protected void Page_Load(object sender, EventArgs e) { Industry = Request.QueryString["_indeustry"].ToString(); InitMap(); getShowMuilt(); }
web.config已经配置为UTF-8 但是还是不行
<system.web> <globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" /> </system.web>
最终解决方案
function webChart() { var t = document.getElementById("txtReceive"); if (t.value == null || t.value == "") { alert("请先进行查询"); } else { var url = encodeURI("map/industryMap.aspx?_indeustry=" + t.value); alert(url); document.getElementById("center-iframe").src = url;}}
结果如下:
<script type="text/javascript"><!--google_ad_client = "ca-pub-1944176156128447";/* cnblogs 首页横幅 */google_ad_slot = "5419468456";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- url字符串编码乱码问题
- URL 编码乱码问题
- URL编码问题&乱码根源
- Mysql 字符串编码,解决各种乱码问题
- 字符串深入学习(编码,解码,乱码问题)
- URL乱码重新编码
- jsp使用URL编码传递中文参数乱码问题
- 浏览器自动转换URL编码产生乱码问题
- MySQL connection.url的编码导致中文乱码问题
- ios对于字符串的url编码和解码问题
- URL编码解决中文乱码
- 使用jquery获取url以及使用jquery获取url参数以及中文编码乱码的问题
- 解决中文拼接在url后的乱码问题--gbk 在url上的编码
- url中文乱码问题最好的解决办法-URL编码与两次encodeURI
- JavaWeb中浏览器URL编码,GET乱码问题方式乱码解决
- JavaWeb中浏览器URL编码,GET乱码问题方式乱码解决
- utf-8 编码的url gb2312编码接收 乱码问题 解决
- Python编程-字符串的编码转换、存储及乱码问题
- webView字体放大
- 一个简单的matlab图形界面程序GUI
- 上篇日本人经营之道 二该强硬时决不手软
- DNS解析过程详解
- 第一次用剪枝
- url字符串编码乱码问题
- Android调用系统自带的文件管理器进行文件选择
- Ubuntu下为Firefox安装Adobe Flash Player
- jenkins update center
- 能够按页号提取word文档文本内容的小程序,由C#实现
- kmp算法详解
- hdu4571 背包
- Calling fork from Multiple Thread Environment
- Linux学习笔记-文件属性与目录配置