特殊字符在Chrome中显示为垃圾


Special characters display as garbage in Chrome

我最近开始使用Chrome进行web开发(以前我使用过FireFox),但遇到了一个问题。

如果我通过POST提交特殊字符,然后在PHP中提交die($_POST['thatvar']);,那么FireFox会在页面上显示符号(在FireBug中也是如此),但Chrome会在页面中显示Ω(尽管它在dev.tools中显示了)。

为什么会发生这种情况?

在头中使用字符集

通过添加

 <meta http-equiv="content-type" content="text/html;  charset=utf-8" />

在你的脑海中

类似:

<head>
 <meta http-equiv="content-type" content="text/html;  charset=utf-8" />
</head>