asp.net 国际化
If you've ever done work in non-English languages with Classic ASP (ASP3) and gotten black squares in side of the characters you expected, your checklist should be something like this.
如果您曾经使用Classic ASP(ASP3)在非英语语言中完成过工作,并且在期望的字符旁边出现了黑色方块,那么您的清单应该是这样的。
切记:每个软件开发人员绝对,肯定必须绝对了解Unicode和字符集(没有任何借口!)
Classic ASP Internationalization "Don't Lie" Checklist
经典的ASP国际化“不要说谎”清单
- Are your ASP pages saved as UTF-8? I recommend Notepad2 (or debug.exe ;) ) as a good editor that knows what a Unicode Byte-Order-Mark looks like. 您的ASP页是否另存为UTF-8? 我建议使用Notepad2(或debug.exe;))作为一个好的编辑器,它知道Unicode字节顺序标记的外观。
There's two aspects to encoding with Classic ASP - there's the encoding of the page (the static stuff) and the encoding of the dynamically created content.
使用Classic ASP进行编码有两个方面-页面(静态内容)和动态创建内容的编码。
Add this little-known bit-o-goodness to your pages:
将此鲜为人知的点点滴滴添加到您的页面中:
Add this little-known bit-o-goodness to your pages:Response.CodePage = 65001
Response.CharSet = "utf-8"将这种鲜为人知的点点好处添加到您的页面中: Response.CodePage = 65001 Response.CharSet =“ utf-8”
Make sure that the strings/content you are consuming is also the correct encoding. A very common problem is having Unicode content in an XML file but the prolog might say:
确保您使用的字符串/内容也是正确的编码。 一个非常普遍的问题是XML文件中包含Unicode内容,但序言可能会说:
Make sure that the strings/content you are consuming is also the correct encoding. A very common problem is having Unicode content in an XML file but the prolog might say: <?xml version="1.0" encoding="iso-1159-1" ?>.
确保您使用的字符串/内容也是正确的编码。 一个非常普遍的问题是XML文件中包含Unicode内容,但是序言可能会说: <?xml version =“ 1.0” encoding =“ iso-1159-1”?> 。
This mistake will go unnoticed until José shows up.
直到何塞(José)出现,这个错误才会被注意到。
Make sure your XML encoding matches you actual encoding:
确保您的XML编码与实际编码匹配:
Make sure your XML encoding matches you actual encoding:<?xml version="1.0" encoding="UTF-8" ?>.
确保您的XML编码与您的实际编码匹配: <?xml version =“ 1.0” encoding =“ UTF-8”?> 。
You might also ensure your Http Headers don't lie:
您还可以确保您的Http标头不会说谎:
You might also ensure your Http Headers don't lie:Content-Type: text/html; charset=utf-8
您还可以确保您的Http标头不会说谎: Content-Type:text / html; 字符集= utf-8
You might also ensure your META tags don't lie:
您还可以确保您的META标签不会说谎:
You might also ensure your META tags don't lie:<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
您还可以确保您的META标签不会说谎: <meta http-equiv =“ Content-Type” content =“ text / html; charset = UTF-8” />
When all these things line up, things tend to just work. Again, this is old-school stuff, so you likely don't care. Move along, nothing to see here.
当所有这些东西排列在一起时,事情往往就可以正常工作。 同样,这是老式的东西,因此您可能不在乎。 继续前进,这里什么也看不到。
翻译自: https://www.hanselman.com/blog/internationalization-and-classic-asp
asp.net 国际化