我该如何解码文字?

时间:2013-01-21 19:27:05

标签: c# json decode

大家好,我有来自服务器的json响应,有这样的文字:

<div class=\"profile-info\">\u0413\u043e\u0440\u043e\u0434: \u041a\u043e\u0432\u0440\u043e\u0432<\/div>

如何解码\u0413\u043e\u0440\u043e\u0434: \u041a\u043e\u0432\u0440\u043e\u0432

1 个答案:

答案 0 :(得分:1)

Regex regex = new Regex(@"\\u([a-f0-9]{4})", RegexOptions.IgnoreCase);
String result = regex.Replace(result, match => ((Char)Int32.Parse(match.Value.Substring(2), NumberStyles.HexNumber)).ToString());