当我尝试使用以下代码显示越南文字时:
<?php
$str = "Nghệ thuật cắm hoa vải";
//echo utf8_encode(html_entity_decode(($str)));
echo html_entity_decode($str);
//echo $str;
?>
我得到了Ngh�?清华�?t c??m hoa va?i的结果。我试了几种方法,但都做不到。有什么想法吗?
发布于 2010-07-08 12:40:00
PHP脚本是用UTF-8编码的吗?如果是,则发送一个标头来指明:
header("Content-type: text/html; charset=utf-8");
或者,执行以下操作:
echo mb_convert_encoding($string, "HTML-ENTITIES", "UTF-8");
发布于 2010-07-08 12:40:26
对我来说很好用:http://codepad.org/uTmORRmz
你的浏览器支持Unicode吗?
https://stackoverflow.com/questions/3203594
复制相似问题