时间:2021-07-01 10:21:17 帮助过:31人阅读
$s = '中文abc';$s = iconv('gbk', 'utf-8', $s); //不是 utf-8 时需转 utf-8print_r(unpack('C*', $s));
Array( [1] => 228 [2] => 184 [3] => 173 [4] => 230 [5] => 150 [6] => 135 [7] => 97 [8] => 98 [9] => 99)C#测试
foreach (var c in UTF8Encoding.UTF8.GetBytes("中文abc")) { Console.WriteLine(c); }
$s = '中文abc';$s = iconv('gbk', 'utf-8', $s); //不是 utf-8 时需转 utf-8print_r(unpack('C*', $s));
Array( [1] => 228 [2] => 184 [3] => 173 [4] => 230 [5] => 150 [6] => 135 [7] => 97 [8] => 98 [9] => 99)C#测试
foreach (var c in UTF8Encoding.UTF8.GetBytes("中文abc")) { Console.WriteLine(c); }