简体   繁体   English

Asp.Net应用程序不正确支持Non-Ascii字符

[英]Asp.Net application not supporting Non-Ascii characters correctly

My .Net application is unable to process some of the Non Ascii characters like '§' etc when reading from the HTML page but a question mark comes in place of that.I have mentioned 我的.Net应用程序在从HTML页面读取时无法处理某些非Ascii字符,例如``§''等,但是用问号代替了。

<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

in my Web.config and saved the files in UTF-8 encoding but still it doesn't work. 在我的Web.config中,并以UTF-8编码保存了文件,但仍然无法正常工作。

What could be the reason?Please help 可能是什么原因?请帮忙

My guess is that you're missing this tag in your views: 我的猜测是您在视图中缺少此标记:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

It doesn't matter if you save the HTML pages correctly as UTF-8, you need to specify within the HTML itself that the client browser needs to render the text content as UTF-8. 是否将HTML页面正确保存为UTF-8无关紧要,您需要在HTML本身中指定客户端浏览器需要将文本内容呈现为UTF-8。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM