gpt4 book ai didi

c# htmlDecode 实体数大于 127

转载 作者:太空宇宙 更新时间:2023-11-03 21:40:11 26 4
gpt4 key购买 nike

你好,我想解码 html 实体,但是当实体数大于 127 时我遇到了问题。

我正在使用 WebUtility.HtmlDecode

示例:

class Program
{

static void Main(string[] args)
{
string text = "`°•»ZEЯO«•°´";
Console.WriteLine(WebUtility.HtmlDecode(text));
Console.ReadKey();
}
}

Output : `°»ZE?O«°´ and not : `°•»ZEЯO«•°´

问题是实体没有正确解码。

Я

我想知道如何解码它,我做了很多搜索但找不到解决方案...

预先感谢您的帮助。

最佳答案

问题不在于 WebUtility.HtmlDecode - 如果您单步执行,您将看到在 Visual Studio 中的表现形式很好。问题是默认情况下,控制台无法显示 Unicode。

关于c# htmlDecode 实体数大于 127,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19729995/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com