1
我正在使用PHP與netbeans IDE,我想打印一些特殊字符,但我不能得到任何工作,我已經嘗試了一些失敗的事情請幫助。打印特殊外來字符
這裏是我當前的代碼
header('Content-Type: text/html;charset=UTF-8');
mb_internal_encoding("UTF-8");
$str = "helloáéíóúñ言文一致";
print $str; //hello������????
print iconv(mb_detect_encoding($str), "UTF-8", $str) . "\n";//throws an error
if(strlen($str)!==strlen(utf8_decode($str))) print $str;
else print utf8_encode($str);
//prints hello������????
print "\n" . mb_internal_encoding(); //UTF-8
是否UTF-8甚至支持這些字符?我幾乎肯定它的確如此。
感謝
我正在尋找將在NetBeans IDE中輸出的代碼。您的即時輸出建議完全不顯示。 mb_internal_encoding(「UTF-8」)確保源編碼是UTF-8 – ZJS