/// <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;
        }
View Code

相关文章:

  • 2022-02-02
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2021-07-06
  • 2021-09-20
  • 2022-12-23
相关资源
相似解决方案