我需要帮助编码“标题”标签。我有一个带有特殊字符的名字,比如“ě,š,č,ř,ž,is,á,í,é”,在demo.browse.php中是工作的。这是我的代码,我不知道,问题出在哪里,你能帮我吗?:)谢谢
<?php
require_once('getid3.php');
$PageEncoding = 'UTF-8';
$getID3 = new getID3;
$getID3->setOption(array('encoding' => $PageEncoding));
$FullFileName = "test.webm";
$ThisFileInfo = $getID3->analyze($FullFileName);
getid3_lib::CopyTagsToComments($ThisFileInfo);
echo '<html><head>';
echo '<title>getID3() - (sample script)</title>';
echo '<meta http-equiv="Content-Type" content="text/html;charset='.$PageEncoding.'" />';
echo '</head><body>';
echo htmlentities(!empty($ThisFileInfo['comments_html']['title'])?implode('<br>', $ThisFileInfo['comments_html']['title']) : chr(160));
echo '</body></html>';
?>答案是:"V zajet& d& #233;mon&# 367;“
原创是:"V zajetídémonů“
我尝试使用iconv();和utf8_encode();不起作用。谢谢
发布于 2014-10-06 20:24:46
您自己对结果调用htmlentities。此调用将变音符号转换为相应的HTML实体。
请改用htmlspecialchars。
https://stackoverflow.com/questions/26216043
复制相似问题