【发布时间】:2010-11-16 21:38:38
【问题描述】:
我需要将 KOI8-R 编码的字符串转换为纯 UTF8
【问题讨论】:
-
请注意,只有在您 100% 知道原始编码是什么时,才能保证在编码之间进行转换。
我需要将 KOI8-R 编码的字符串转换为纯 UTF8
【问题讨论】:
你可以使用mb_convert_encoding:
$output = mb_convert_encoding($input, 'UTF-8', 'KOI8-R');
【讨论】:
$output = iconv('KOI8-R', 'UTF-8', $input);
也有效:)
还可以选择删除损坏或无法识别的字符
iconv("KOI8-R", "UTF-8//IGNORE", $text)
但你需要安装 iconv。
【讨论】: