一切福田,不離方寸,從心而覓,感無不通。

C# Unicode与中文互转

中文转Unicode:HttpUtility.UrlEncodeUnicode(string str); 转换后中文格式:"%uxxxx"  举例:"柳_abc123"  转换结果是:"%u67f3_abc123" Unicode转中文1:HttpUtility.UrlDecode(string str); str格式:"%uxxxx" ,举例:"%u67f3_abc123" Unicode转中文2:Regex.Unescape(string str); str格式:"\uxxxx" ,举例:"\u67f3_abc123"   ================================ 符合js规则的转换         /// <summary>         /// 中文转unicode(符合js规则的)         /// </summary>         /// <returns></returns>         public static string unicode_js_0(string str)         {             string outStr = "";             string a = "";             if (!string.IsNullOrEmpty(str))             {   […]

龙生   05 Jun 2017
View Details