In C #, which method does UTF8Encoding. UTF8.GetBytes (key) correspond to in PHP? How to write? In C #, which method does UTF8Encoding. UTF8.GetBytes (key) correspond to in PHP?
How to write?
Reply to discussion (solution)
$ S = 'Chinese ABC'; $ s = iconv ('gbk', 'utf-8', $ s ); // The utf-8print_r (unpack ('C * ', $ s) is not required when UTF-8 is not used ));
Array( [1] => 228 [2] => 184 [3] => 173 [4] => 230 [5] => 150 [6] => 135 [7] => 97 [8] => 98 [9] => 99)
C # Test
Foreach (var c in UTF8Encoding. UTF8.GetBytes ("Chinese abc") {Console. WriteLine (c );}
$ S = 'Chinese ABC'; $ s = iconv ('gbk', 'utf-8', $ s ); // The utf-8print_r (unpack ('C * ', $ s) is not required when UTF-8 is not used ));
Array( [1] => 228 [2] => 184 [3] => 173 [4] => 230 [5] => 150 [6] => 135 [7] => 97 [8] => 98 [9] => 99)
C # Test
Foreach (var c in UTF8Encoding. UTF8.GetBytes ("Chinese abc") {Console. WriteLine (c );}