法语字符显示不正确


French characters not being displayed properly

我正在使用curl来拉入新闻提要,然而法语版本拉入了一些奇怪的字符。

例如,"activitâ©s"应为"activités"

$feed = curl_init($json);
$options = array(
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_HTTPHEADER => array('Content-type: application/json'),
   CURLOPT_POSTFIELDS => $feed
);
curl_setopt_array($feed, $options);
$news = curl_exec($feed);
curl_close($feed);
$articles = json_decode($news, true);

您是否尝试设置正确的字符集,即CURLOPT_HTTPHEADER => array('Content-type: application/json', 'charset=utf-8')

这可能会解决你的问题。