同一文件在两台服务器上以不同方式显示UTF-8字符

时间:2012-01-08 21:37:18

标签: php utf-8

在实习生后面清理:这个包含法语文本的文件在我的testbed服务器上正确显示重音UTF-8字符

http://www.surreydata.dreamhosters.com/index.php?page=project_presentation_fr

该页面有<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

当页面移动到生产服务器时,即使

,字符也不会正确显示

<? header('Content-Type:text/html; charset=UTF-8'); ?>已添加。

http://vps6533.inmotionhosting.com/~hnocor5/surrey/index.php?page=project_presentation_fr

但是,如果直接访问包含,编码问题就会消失:

http://vps6533.inmotionhosting.com/~hnocor5/surrey/project_presentation_fr.php

有关如何纠正此事的任何建议?

Live HTTP Headers初始块显示正确的编码。

http://vps6533.inmotionhosting.com/~hnocor5/surrey/index.php?page=project_presentation_fr

GET /~hnocor5/surrey/index.php?page=project_presentation_fr HTTP/1.1
Host: vps6533.inmotionhosting.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive

HTTP/1.1 200 OK
Date: Sun, 08 Jan 2012 21:31:28 GMT
Server: Apache
Keep-Alive: timeout=3, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

1 个答案:

答案 0 :(得分:1)

注意,当我将charset更改为:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>

似乎有效。演示:

http://jfcoder.com/test/index.php.htm