使用 JSON 进行解析时,我的"Suite Exécutive"
文字无效。
您是否知道如何在 C#中解码此文字?感谢
答案 0 :(得分:2)
如果使用ASP.NET,您可以尝试
HttpUtility.HtmlDecode Method (String)
using System;
using System.Web;
using System.IO;
class MyNewClass
{
public static void Main()
{
String myString;
Console.WriteLine("Enter a string having '&' or '\"' in it: ");
myString = Console.ReadLine();
// String myEncodedString;
// Encode the string.
// myEncodedString = HttpUtility.HtmlEncode(myString);
// Console.WriteLine("HTML Encoded string is " + myEncodedString);
StringWriter myWriter = new StringWriter();
// Decode the encoded string.
// HttpUtility.HtmlDecode(myEncodedString, myWriter);
HttpUtility.HtmlDecode(myString, myWriter);
Console.Write("Decoded string of the above encoded string is " +
myWriter.ToString());
Console.Read();
}
}
在 .Net 4.0
上System.Net.WebUtility.HtmlDecode(..)