我目前正在为我的一个项目开发经典 ASP。对于非英语语言,我得到的是方框而不是特殊字符。我使用 UTF-8 进行渲染,但有时字符会出现在框中。有时点击刷新就恢复正常了。
我按照以下所有步骤操作,但仍然遇到此问题
XML:
-
HTML:
>
-
内容类型:text/html; charset=utf-8
我在这里遗漏了什么吗?谢谢。
I am currently working on Classic ASP for one of my project. For non English languages I am getting boxes instead of special characters. I am rendering using UTF-8 but sometimes the characters goes to boxes. It comes back normal when I click refresh sometimes.
I followed all the steps below but i still get this problem
-
XML:
<xml version="1.0" encoding="UTF-8">
-
HTML:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-
content-type: text/html; charset=utf-8
Am I missing anything here? Thanks.
发布评论
评论(2)
将其添加到您的页面:
现在应该可以正确显示所有内容。
希望有帮助
Add this to your page:
It should display all correctly now.
Hope that helps
太神奇了,但是没有人给出正确执行此操作的完整答案...我希望这可以帮助像我这样的人,因为很难找到完整的图片...
------------ ---- 先前的考虑因素 --------------
首先,确保 IIS 没有替换代码页...转到 IIS,单击网站,打开 ASP 模块,在行为上应该是>>代码页 = 0
第二,应该检查文件本身,是的!文件...在Windows(我的电脑)上打开文件资源管理器,转到您的网站文件所在的文件夹,例如“default.asp”,右键单击>>打开>>记事本然后单击文件>>另存为...在底部的对话框中显示“编码”,确保它具有 UTF-8,否则您将必须添加
在每个页面(包括服务器端),这是不正确的。
---------------- 页面的正确结构 --------------
现在应该可以与查询字符串、数据库和常规 HTML 一起正常工作...噗噗
It's amazing BUT nobody gives a complete answer on what to do this PROPERLY... I hope this help somebody like me, because it was so hard to find the whole picture...
---------------- PREVIOUS CONSIDERATIONS --------------
FIRST, make sure IIS IS NOT replacing the Code Page... Go to IIS, click the Website, open ASP module, on Behavior it should be >> Code Page = 0
SECOND, The file itself should be checked, YES! the file... open your file explorer on windows (my computer), go to the folder where the files of your website are, take for example "default.asp", right click >> open with >> notepad THEN click on File >> Save As... IN THE DIALOG at the bottom says "Encoding", make sure it has UTF-8, otherwise you will have to add the
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
in every page (including server side includes), which is not correct.---------------- CORRECT STRUCTURE OF THE PAGE --------------
It should work fine now with QueryStrings, Database and regular HTML... uffff