iconv 突然返回问号,我做错了什么?

Ste*_*sen 4 php iconv

我的 iconv 代码昨天运行得很好。今天突然在应该翻译的部分显示了那些问号(\xef\xbf\xbd)。

\n\n
setlocale(LC_ALL, \'nl_NL\');\n    $title = str_replace(\' & \', \' &amp; \', $feed[$x][\'title\']);\n    $title = (iconv(\'UTF-8\', \'ISO-8859-1//TRANSLIT//IGNORE\', $title));\n    $link = $feed[$x][\'link\'];\n    $description = $feed[$x][\'desc\'];\n    $description = (iconv(\'UTF-8\', \'ISO-8859-1//TRANSLIT//IGNORE\', $description));\n    $datedag = date(\'d\', strtotime($feed[$x][\'date\']));\n    $datemaand = date(\'F\', strtotime($feed[$x][\'date\']));\n    $datejaar = date(\'Y\', strtotime($feed[$x][\'date\']));\n    echo \'<div style="border:1px solid black;background-color:#d90000;"><p><strong><a href="\'.$link.\'" title="\'.$title.\'" target="_blank">\'.$title.\'</a></strong><br />\';\n    echo \'<small><em>Geplaatst op \'.$datedag.\' \'.$datemaand.\', \'.$datejaar.\'</em></small></p>\';\n    echo \'<p>\'.$description.\'</p></div><br />\';\n
Run Code Online (Sandbox Code Playgroud)\n\n

现在,我直到出现问号才添加 setlocale,但没有成功。

\n\n

问题:我做错了什么?

\n

Jos*_*abr 6

这对我有用

setlocale(LC_ALL, 'en_US.UTF-8');
Run Code Online (Sandbox Code Playgroud)

虽然我的语言是捷克语。归功于斯通