为什么htmlenties()转换符号:´;转换为â;€™?应该';t将其转换为html实体名称:


why does htmlentities() convert the symbol: ´ into ’? Shouldn't it convert into the html entity name: ´?

可能重复:
PHP htmlenties()未按预期工作

我很困惑为什么它会被转换成奇怪的字符,而不仅仅是´。有人能给我指明正确的方向吗?

使用第二个flags参数-http://php.net/manual/en/function.htmlentities.php,例如

htmlentities( $string, ENT_QUOTES | ENT_SUBSTITUTE, "UTF-8" );
相关文章: