转换为UTF8编码

public static string UTF16To8(string str)
{
    byte[] utf16Bytes = Encoding.Unicode.GetBytes(str);
    byte[] utf8Bytes = Encoding.Convert(Encoding.Unicode, Encoding.UTF8, utf16Bytes);
    return Encoding.UTF8.GetString(utf8Bytes);
}