广告位,联系QQ:910488011
当前位置: 首页 > 文档下载 > c# Unicode编码转明文代码
文档下载
c# Unicode编码转明文代码
作者: admin  时间: 2012-07-02  点击: 5243
public static string ConvertUnicodeStringToChinese(string unicodeString)

{

if (string.IsNullOrEmpty(unicodeString))

return string.Empty;



string outStr = unicodeString;



Regex re = new Regex("\\\\u[0123456789abcdef]{4}", RegexOptions.IgnoreCase);

MatchCollection mc = re.Matches(unicodeString);

foreach (Match ma in mc)

{

outStr = outStr.Replace(ma.Value, ConverUnicodeStringToChar(ma.Value).ToString());

}

return outStr;

}