编码问题...... [英] Encoding problem......

查看:47
本文介绍了编码问题......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用IIS6网络服务器开发多语言ASP / HTML网站。


以这种方式完美地使用两种语言(英语和意大利语):

- 基本上每种语言的ASP代码基本相同

- 特定于语言的内容存储在文本文件中,每种语言都有它自己的b
目录内容。

- 增强可用性和格式化特定于语言的内容

用html语法存储;基本上代码通常位于

< bodyand< / bodystatements。

- ASP代码加载那些(html)文件并用

dinamically生成的html代码,然后将所有内容输出到浏览器。


此处没有问题。它的工作原理


所以我决定试一试中文并完成任务我做了b $ b做了:

- 在.asp页面中插入以下代码


<%@ CodePage = 65001语言=" VBScript"%>

<%

Response.CodePage = 65001

Response.CharSet =" utf-8"

%>


- 更改了输出页面的HTML标题:


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


- 保存包含UTF-8编码中文字符的asp页面


到此为止一切正常并且浏览器(IE7)正确显示中文

字符。


现在出现问题。


因为我'在ASP代码加载来自磁盘上的文本文件的一些HTML代码之前已经说过了,并且格式化它们。那些html模板里面有中文对应的文本

,并且存储在UTF-8中,但是当显示在浏览器中时

这些字符被其他东西搞砸了。 ASP生成的中文字符

显示正确,但文本文件中的内容是

不是!


可以吗当ASP代码从磁盘加载文本文件时,

内容搞砸了



网络服务器试图''翻译''已经是UTF-8编码的文本?

I''m working on a multilanguage ASP/HTML site using a IIS6 web server.

It perfectly works with two languages (english and italian) in this way:
- basically the same ASP code for every language
- language-specific content is stored in text files, every language has it''s
own directory contents.
- to enhance usability and formatting the language-specific contents are
stored with html syntax; basically the code that normally stands between the
<bodyand </bodystatements.
- the ASP code loads those (html) files and it arranges them with
dinamically generated html code, then it outputs everything to the browser.

No problems here. It works

So I''ve decided to give it a try with chinese and to accomplish the task I
did:

- 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">

- Saved the asp pages containing chinese characters in UTF-8 encoding

Till here everything works properly and the browser (IE7) shows chinese
characters correctly.

Now the problem.

As I''ve said before ASP code loads some html code from text files on disk
and formats them. Those html templates have the chinese-counterpart text
inside and are stored in UTF-8, nevertheless when showed into the browser
the characters are scrambled up in something else. The chinese characters
generated by ASP are shown correctly, but the contents in the text files are
not!

Could it be that when the ASP code loads the text file from disk, the
contents gets screwed up
or
the web server tries to ''translate'' the allready UTF-8 encoded text?


推荐答案

任何帮助??? :-)


" Atlas" < at ******* @ my-deja.com在留言中写道

新闻:12 ************* @ news.supernews.com .. 。
Any help ??? :-)


"Atlas" <at*******@my-deja.comwrote in message
news:12*************@news.supernews.com...

我正在使用IIS6网络服务器在多语言ASP / HTML网站上工作。


完美无缺以这种方式使用两种语言(英语和意大利语):

- 每种语言的ASP代码基本相同

- 特定于语言的内容存储在文本文件中,每种语言具有

它自己的目录内容。

- 增强可用性和格式化特定于语言的内容

用html语法存储;基本上代码通常介于

< bodyand< / bodystatements。

- ASP代码加载那些(html)文件并用

dinamically生成的html代码,然后将所有内容输出到

浏览器。


这里没问题。它的工作原理


所以我决定试一试中文并完成任务我做了b $ b做了:

- 在.asp页面中插入以下代码


<%@ CodePage = 65001语言=" VBScript"%>

<%

Response.CodePage = 65001

Response.CharSet =" utf-8"

%>


- 更改了输出页面的HTML标题:


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


- 保存包含UTF-8编码中文字符的asp页面


到此为止一切正常并且浏览器(IE7)正确显示中文

字符。


现在出现问题。


因为我'在ASP代码加载来自磁盘上的文本文件的一些HTML代码之前已经说过了,并且格式化它们。那些html模板里面有中文对应的文本

,并且存储在UTF-8中,但是当显示在浏览器中时

这些字符被其他东西搞砸了。 ASP生成的中文字符

显示正确,但文本文件中的内容

不是!


可以吗当ASP代码从磁盘加载文本文件时,

内容搞砸了



网络服务器试图''翻译''已经是UTF-8编码的文本?

I''m working on a multilanguage ASP/HTML site using a IIS6 web server.

It perfectly works with two languages (english and italian) in this way:
- basically the same ASP code for every language
- language-specific content is stored in text files, every language has
it''s own directory contents.
- to enhance usability and formatting the language-specific contents are
stored with html syntax; basically the code that normally stands between
the <bodyand </bodystatements.
- the ASP code loads those (html) files and it arranges them with
dinamically generated html code, then it outputs everything to the
browser.

No problems here. It works

So I''ve decided to give it a try with chinese and to accomplish the task I
did:

- 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">

- Saved the asp pages containing chinese characters in UTF-8 encoding

Till here everything works properly and the browser (IE7) shows chinese
characters correctly.

Now the problem.

As I''ve said before ASP code loads some html code from text files on disk
and formats them. Those html templates have the chinese-counterpart text
inside and are stored in UTF-8, nevertheless when showed into the browser
the characters are scrambled up in something else. The chinese characters
generated by ASP are shown correctly, but the contents in the text files
are not!

Could it be that when the ASP code loads the text file from disk, the
contents gets screwed up
or
the web server tries to ''translate'' the allready UTF-8 encoded text?





" Atlas" < at ******* @ my-deja.com在留言中写道

新闻:12 ************* @ news.supernews.com .. 。

"Atlas" <at*******@my-deja.comwrote in message
news:12*************@news.supernews.com...

我正在使用IIS6网络服务器在多语言ASP / HTML网站上工作。


完美无缺以这种方式使用两种语言(英语和意大利语):

- 每种语言的ASP代码基本相同

- 特定于语言的内容存储在文本文件中,每种语言有
I''m working on a multilanguage ASP/HTML site using a IIS6 web server.

It perfectly works with two languages (english and italian) in this way:
- basically the same ASP code for every language
- language-specific content is stored in text files, every language has



它是

it''s


自己的目录内容。

- 增强可用性和格式化特定于语言的内容是用btml语法存储的b $ b;基本上代码通常介于
own directory contents.
- to enhance usability and formatting the language-specific contents are
stored with html syntax; basically the code that normally stands between




the


< bodyand< / bodystatements。

- ASP代码加载那些(html)文件,它用

dinamically生成的html代码排列它们,然后它将所有内容输出到
<bodyand </bodystatements.
- the ASP code loads those (html) files and it arranges them with
dinamically generated html code, then it outputs everything to the



浏览器。

browser.


>

此处没有问题。它的工作原理


所以我决定试一试中文并完成任务我做了b $ b做了:

- 在.asp页面中插入以下代码


<%@ CodePage = 65001语言=" VBScript"%>

<%

Response.CodePage = 65001

Response.CharSet =" utf-8"

%>


- 更改了输出页面的HTML标题:


< meta http-equiv =" Content-Type"含量=" text / html的;
>
No problems here. It works

So I''ve decided to give it a try with chinese and to accomplish the task I
did:

- 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 encoding

Till here everything works properly and the browser (IE7) shows chinese
characters correctly.

Now the problem.

As I''ve said before ASP code loads some html code from text files on disk
and formats them. Those html templates have the chinese-counterpart text
inside and are stored in UTF-8, nevertheless when showed into the browser
the characters are scrambled up in something else. The chinese characters
generated 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 the
content of these text files into the response. You may be able to elicit
more help if you post the example code you are using to place the content
into 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, the
contents gets screwed up
or
the 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 elicit
more help if you post the example code you are using to place the content
into 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?


这篇关于编码问题......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆