我有一个包含一些UNI code,我怎么把它转换为UTF-8编码字符串?
I have a string that contains some unicode, how do I convert it to UTF-8 encoding?
这个片段使得字节与您的字符串连接在codeD UTF-8的数组:
This snippet makes an array of bytes with your string encoded in UTF-8:
UTF8Encoding utf8 = new UTF8Encoding();
string unicodeString = "Quick brown fox";
byte[] encodedBytes = utf8.GetBytes(unicodeString);