- 在.asp页面中插入以下代码 <%@ CodePage = 65001语言=" VBScript"%> <% Response.CodePage = 65001 Response.CharSet =" utf-8" %> - 更改了输出页面的HTML标题: < meta http-equiv =" Content-Type"含量=" text / html的;>No problems here. It worksSo I''ve decided to give it a try with chinese and to accomplish the task Idid:- Inserted the following code in the .asp pages <%@ CodePage=65001 Language="VBScript"%> <% Response.CodePage = 65001 Response.CharSet = "utf-8" %>- Changed the HTML header of output pages: <meta http-equiv="Content-Type" content="text/html; charset = UTF-8">charset=UTF-8"> > - 保存包含UTF-8编码中文字符的asp页面 直到这里一切正常,浏览器(IE7)正确显示中文 字符。 现在问题。 正如我之前所说的,ASP代码从磁盘上的文本文件加载一些html代码 并格式化它们。那些html模板里面有中文对应的文本 ,并且存储在UTF-8中,但是当显示在浏览器中时 这些字符被其他东西搞砸了。 ASP生成的中文字符 正确显示,但文本文件中的内容>- Saved the asp pages containing chinese characters in UTF-8 encodingTill here everything works properly and the browser (IE7) shows chinesecharacters correctly.Now the problem.As I''ve said before ASP code loads some html code from text files on diskand formats them. Those html templates have the chinese-counterpart textinside and are stored in UTF-8, nevertheless when showed into the browserthe characters are scrambled up in something else. The chinese charactersgenerated by ASP are shown correctly, but the contents in the text files 是are 不是!not! 显然,这个问题的焦点是用于将这些文本文件的 内容放入响应中的代码。如果您发布用于将内容 放入响应中的示例代码,您可能会获得更多帮助。 但是我的猜测是你使用Scripting.FileSystemObject来做这件事。 这个对象不支持UTF-8。Clearly the focal point of this problem is the code you use to place thecontent of these text files into the response. You may be able to elicitmore help if you post the example code you are using to place the contentinto the response.However my guess is you are using Scripting.FileSystemObject to do this.This object does not support UTF-8. > 可能是当ASP代码从磁盘加载文本文件时, 内容搞砸了 或 网络服务器试图翻译全部UTF-8编码文本?>Could it be that when the ASP code loads the text file from disk, thecontents gets screwed up orthe web server tries to ''translate'' the allready UTF-8 encoded text?显然,这个问题的焦点是用于将这些文本文件的Clearly the focal point of this problem is the code you use to place the 内容放入响应中的代码。如果您发布用于将内容 放入响应中的示例代码,您可能会获得更多帮助。 但是我的猜测是你使用Scripting.FileSystemObject来做这件事。 这个对象不支持UTF-8。content of these text files into the response. You may be able to elicitmore help if you post the example code you are using to place the contentinto the response.However my guess is you are using Scripting.FileSystemObject to do this.This object does not support UTF-8. 同上! 我使用Scripting.FileSystemObject从磁盘加载内容! 是否有一些解决方案?Ditto!I''am using Scripting.FileSystemObject to load contents from disk!Are there some solutions? 这篇关于编码问题......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-29 22:50