问题描述
我使用的是托管公司,它会列出一个目录中的文件,如果文件 index.html的
是不存在的。但是,它会使用ISO-8859-1为默认编码。如果服务器是Apache的,有没有办法改变它使用UTF-8作为默认呢?
I am using a hosting company and it will list the files in a directory if the file index.html
is not there. However, it will use iso-8859-1 as the default encoding. If the server is Apache, is there a way to change it to use UTF-8 as the default instead?
更新:其实,我发现,它实际上是使用HTML 3.2的DOCTYPE,然后有没有字符集在所有...所以不设置任何编码。但是,有没有办法改变它使用UTF-8?
Update: actually, I found that it is actually using a DOCTYPE of HTML 3.2 and then there is not charset at all... so it is not setting any encoding. But is there a way to change it to use UTF-8?
推荐答案
在httpd.conf中添加(或更改,如果它已经存在):
In httpd.conf add (or change if it's already there):
AddDefaultCharset utf-8
这篇关于如何更改默认编码为UTF-8服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!