0

I have the following text which I manually enter into the wordpress posts table

‚

I encode into utf-8 using:

$text = "‚";
$enc = mb_detect_encoding($text, "UTF-8,ISO-8859-1");
$hotelDescription   = iconv($enc, "UTF-8", $text);

However, when wordpress echoes it it displays

‚

Any ideas who I can output the correct characters?

4

2 回答 2

0

看起来你错过了 #226; 之前的 &

于 2012-07-28T00:00:14.173 回答
0

您需要指定显示该字符串的页面使用 UTF-8 编码呈现。您发布的输出是该 utf-8 字符串的 iso-8859-1 版本。假设数据以 UTF-8 格式正确存储在数据库中,请确保呈现此字符串的页面具有以下元标记:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
于 2012-07-28T00:04:44.033 回答