1

我有一个 UTF-8 格式的字符串,并且有代码页(数字)。如何将 UTF-8 字符串转换为代码页?

4

2 回答 2

1

好的,看起来我找到了:

$out = iconv("UTF-8", 'Windows-1252//TRANSLIT//IGNORE', $out);

需要一个 Windows- 前缀。也很好翻译和忽略

于 2012-06-12T08:25:42.737 回答
1
$string = "äöå"; //File is saved as UTF-8
$codepage = unpack("N*",mb_convert_encoding( $string, "UTF-32BE", "UTF-8" ));

var_dump( $codepage );

//array(3) { [1]=> int(228) [2]=> int(246) [3]=> int(229) }
于 2012-06-11T14:04:19.250 回答