解决在aspx页面上进行传中文参数时会出现乱码问题
2009-06-27 16:35
405 查看
解决办法有两种:
其一,在web配置文件中将
<globalization requestEncoding="utf-8" responseEncoding="utf-8"
改为:
<globalization requestEncoding="GB2312" responseEncoding="GB2312"/>
但是这样可能会引起其它页面显示问题,要权衡使用。
其二,在发送请求页面和接收请求页面,使用强制编码和编码之后的转换
发送页面:
string strResponse;
//转换为中文编码
strResponse= HttpUtility.UrlEncode(strResponse,System.Text.Encoding.GetEncoding("GB2312"));
接收页面
string strResponse;
//还原
System.Collections.Specialized.NameValueCollection URLgb2312 = HttpUtility.ParseQueryString(Request.Url.Query, System.Text.Encoding.GetEncoding("GB2312"));
reportName = URLgb2312["strResponse"];
其一,在web配置文件中将
<globalization requestEncoding="utf-8" responseEncoding="utf-8"
改为:
<globalization requestEncoding="GB2312" responseEncoding="GB2312"/>
但是这样可能会引起其它页面显示问题,要权衡使用。
其二,在发送请求页面和接收请求页面,使用强制编码和编码之后的转换
发送页面:
string strResponse;
//转换为中文编码
strResponse= HttpUtility.UrlEncode(strResponse,System.Text.Encoding.GetEncoding("GB2312"));
接收页面
string strResponse;
//还原
System.Collections.Specialized.NameValueCollection URLgb2312 = HttpUtility.ParseQueryString(Request.Url.Query, System.Text.Encoding.GetEncoding("GB2312"));
reportName = URLgb2312["strResponse"];
相关文章推荐
- 解决asp页面向aspx页面传递中文参数乱码问题
- JSP传递参数至另一个JSP页面时中文乱码问题的解决
- C# asp.net页面通过URL参数传值中文乱码问题解决办法
- C# asp.net页面通过URL参数传值中文乱码问题解决办法
- js页面之间以及vue $http请求向后台传递参数中文乱码问题解决
- C# asp.net页面通过URL参数传值中文乱码问题解决办法
- 解决javascript通过url向Jsp页面传递中文参数乱码问题
- JSP页面中超链接传递中文参数出现乱码问题解决方法
- 解决页面传到后台含中文参数时会乱码问题
- C# asp.net页面通过URL参数传值中文乱码问题解决办法
- 解决SpringMVC Controller 接收页面传递的中文参数出现乱码的问题
- 页面中文参数乱码问题解决,HttpCookie乱码
- 前台页面使用utf-8编码,url中包含中文参数时后台获取参数乱码问题解决
- asp.net页面通过URL参数传值中文乱码问题解决办法
- asp.net页面通过URL参数传值中文乱码问题解决办法
- javascript 对url参数进行编码(解决中文乱码问题)
- asp.net页面通过URL参数传值中文乱码问题解决办法
- C# asp.net页面通过URL参数传值中文乱码问题解决办法
- asp.net页面通过URL参数传值中文乱码问题解决办法
- JavaScript跳转页面/Action并传递中文参数[解决js超链接传递过程中产生的中文乱码问题]