/// <summary> /// 获取转UTF8的字符串 /// </summary> /// <param name="strWord"></param> /// <returns></returns> public static string GetUtf8String(string strWord) { string strRes = string.Empty; if (string.IsNullOrEmpty(strWord)) { return strRes; } string s = BitConverter.ToString(System.Text.Encoding.UTF8.GetBytes(strWord)); foreach (byte b in Encoding.UTF8.GetBytes(s)) { strRes += '%' + b.ToString("X"); } return strRes; }