ASP.NET网站乱码

a19895161989516 a19895161989516 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
1.在我本机不会乱码,发布到服务器就乱码了


默认的不传参数不会乱码
http://www.brother.cn/printer/casestudy/case.html


传参数就会乱码
http://www.brother.cn/printer/casestudy/cate.html?type=1&keyword=%E5%BD%A9%E8%89%B2%E4%B8%80%E4%BD%93%E6%9C%BA

前台Encode

<a href="<%=Html.link("casestudy", "cate")%>?type=1&keyword=<%=Server.UrlEncode(objEntity.case_group_by_product)%>"><%=objEntity.case_group_by_product%></a>

后台Decode
keyword = Utils.FilterStr(Server.UrlDecode(keyword.Trim()), 100);


web.config 中也加了

<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8" culture="zh-CN" />

页面也设置了
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
a19895161989516
.NET社区 62,274 成员 668,968 内容