|
|
|
7i24.Com不停为您服务
我刚下载、安装了ASP.Net,可是看到网页中的中文全是问号,不管用什么编码都不行。请问是什么原因啊?谢啦!!
raymond 发表于 2002-1-22 15:45:57
在你的应用程序起点目录有一个文件:
web.config
内容如下:
<configuration>
<configSections>
<sectionGroup name="system.web">
<section name="sourceview" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
</configSections>
<appSettings>
<add key="RemoteHost" value="false" />
</appSettings>
<system.web>
<!-- <identity impersonate="true" /> -->
<sourceview>
<add key="root" value="C:\.NET\Samples\QuickStart" />
</sourceview>
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" culture="en-US" fileEncoding="UTF-8" />
</system.web>
</configuration>
把它改成以下内容:
<configuration>
<configSections>
<sectionGroup name="system.web">
<section name="sourceview" type="System.Configuration.NameValueSectionHandler,System,Version=1.0.3300.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
</configSections>
<appSettings>
<add key="RemoteHost" value="false" />
</appSettings>
<system.web>
<!-- <identity impersonate="true" /> -->
<sourceview>
<add key="root" value="C:\.NET\Samples\QuickStart" />
</sourceview>
<globalization requestEncoding="UTF-8" responseEncoding="GB2312" culture="en-GB" fileEncoding="GB2312" />
</system.web>
</configuration>
关键在于这一行:
requestEncoding="UTF-8" responseEncoding="GB2312" culture="en-GB" fileEncoding="GB2312"
它保证了中文GB2312的正常输出!
互联网是一种病毒,我已病得奄奄一息了。
|
|
|