ICEcoder显示汉字出现乱码的处理

在网上看到icecoder这个小东西,是一个基于web的编辑器,很不错。唯一的缺点是打开的文件中汉字会变成乱码。

经查看源代码,在lib/file-control.php中,第89行是:

echo '</script><textarea name="loadedFile" id="loadedFile">'.htmlentities($loadedFile).'</textarea><script>';

原来如此,htmlentities会把汉字变成乱码,换成功能类似的htmlspecialchars:
echo '</script><textarea name="loadedFile" id="loadedFile">'.htmlspecialchars($loadedFile).'</textarea><script>';

问题解决,暂时没有异常出现。

posted on 2015-07-20 09:37  anjo  阅读(776)  评论(0编辑  收藏  举报