/// <summary> /// Unicode 转换 ASCII /// </summary> /// <param name="theText">解码内容</param> /// <returns></returns> public static string unHTMLEncode(string theText) { try { string output = string.Empty; if (theText.Contains("&#")) { return System.Text.RegularExpressions.Regex.Replace( theText, @"&#(?<Value>[a-zA-Z0-9]{5});", m => { return ((char)int.Parse(m.Groups["Value"].Value)).ToString(); }); } string[] stringArray = theText.Split(' '); if (stringArray.Length == 1) return theText; for (int i = 0; i < stringArray.Length - 1; i++) { int n; if (int.TryParse(stringArray[i], out n)) output += (char)int.Parse(stringArray[i]); else output += stringArray[i]; } return output; } catch (Exception ex) { throw ex; } }