Lat*_*san 7 php utf-8 character-encoding
我有以下地址:Praha 5,StaréMěsto,
我需要在此字符串上使用utf8_decode()函数,然后才能将其写入PDF文件(使用domPDF lib).
但是,上述地址行的php utf8解码功能显示不正确(或者更确切地说,不完整).
以下代码:
<?php echo utf8_decode('Praha 5, Staré M?sto,'); ?>
Run Code Online (Sandbox Code Playgroud)
产生这个:
Praha 5,StaréM?sto,
知道为什么ě没有被解码?
dec*_*eze 14
utf8_decode 将字符串从UTF-8编码转换为ISO-8859-1,即"Latin-1".
Latin-1编码不能代表字母"ě".就这么简单.
"Decode"总是用词不当,它的确如此iconv('UTF-8', 'ISO-8859-1', $string).
| 归档时间: |
|
| 查看次数: |
14221 次 |
| 最近记录: |