好的,这里有什么问题?
header('Content-type: text/html; charset=utf-8');
setlocale(LC_ALL, NULL);
setlocale(LC_ALL, 'pt_BR');
echo "<p>São Paulo, " . date("d \d\e F \d\e Y", time()) . "</p>";
echo "<p>Preferred locale on this system is '" . setlocale(LC_ALL, NULL) . "'</p>";
回声:
São Paulo, 24 de April de 2012
Preferred locale on this system is 'Portuguese_Brazil.1252'
也尝试过类似的东西:
setlocale(LC_ALL, 'Portuguese_Brazil.1252', 'bra', 'brazil', 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8', 'portuguese', 'portuguese-brazil', 'ptb');
但是没有什么能让'aPril'变成'aBril'。
谢谢。
PS:文档是 IDE 格式的 UTF.8(无 BOM)。