3
String Text = "This is example ”Text”";
Text = WebUtility.HtmlDecode(Text);
System.IO.File.WriteAllText(@"c:\x.txt", Text, Encoding.ASCII);

正确的输出:

This is example ”Text”

x.txt 的输出:

This is example ?Text?
4

1 回答 1

0

您可以使用“iso-8859-1”编码:

改变

System.IO.File.WriteAllText(@"c:\x.txt", Text, Encoding.ASCII);

System.IO.File.WriteAllText(@"c:\x.txt", Text, Encoding.GetEncoding(28591));
于 2013-10-16T14:51:32.750 回答