我的wordpressthe_content给了我垃圾字符"£;45〃;,不确定在哪里检查编码


My wordpress the_content is giving me trash characters "£45", not sure where to check for encoding

每当我使用£符号时,我都会拾取垃圾字符,我认为我的编码有问题。

我已经在使用:

<meta charset="utf-8">

我的apache2.conf 中有AddDefaultCharset utf-8

哦,是的,我正在the_content上做一些过滤,但我已经应用了这个:

$html = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8");

我还应该声明,这种情况不会在本地发生。

还有其他地方需要我声明编码吗?

当我遇到这个问题时,我最终做了:

$str = str_replace("£", "&pound;", $str);

不过,我确信这不是最好的方法。

编辑:确保您的数据库设置为utf8_general_ci