我了解到ISO-8859-1是一个单字节字符集。
HTTP 标头和元标记表明它使用ISO-8859-1作为字符编码。
但在此页面中使用了一个两字节字符 (0x201A) ( http://unicodelookup.com/#%E2%80%9A )。
(复制字符并在http://unicodelookup.com中查找)
<div id="articleTitleMal" style="padding-top:10px;">
<font face= "Manorama" >
¼ÈØOVA¢: ÜÍß‚Äí 1.28 ...
</font>
</div>
如何在单字节编码中使用两个字节字符?
我不是好奇地知道这一点。由于不了解上述问题,我的一项任务被卡住了。
更新:他们正在使用字体 www.manoramaonline.com/portal/mmcss/Manorama.ttf,我认为 Manaorama-font 中的某些字符使用两个字节。
UPDATE2:我尝试使用以下代码将文档从 ISO-8859-1 转换为 UTF-8。
<?php
$t = file_get_contents('http://www.manoramaonline.com/cgi-bin/MMOnline.dll/portal/ep/malayalamContentView.do?tabId=11&programId=1073753760&BV_ID=@@@&contentId=15238737&contentType=EDITORIAL&articleType=Malayalam%20News');
// Change the charset info in meta-tag
$t = str_replace('ISO-8859-1', 'UTF-8', $t);
file_put_contents('t.html', utf8_encode($t));
那个时候上面选择的字符丢失了。