gpt4 book ai didi

vb.net 字符集

转载 作者:行者123 更新时间:2023-12-04 23:09:26 25 4
gpt4 key购买 nike

根据 MSDN vb.net uses this extended character set .根据我的经验,它实际上使用了这个:

alt text

  • 我错过了什么?为什么它说它使用一个而使用另一个?
  • 难道我做错了什么?
  • 是否有某种到原始字符集的转换工具?
  • 最佳答案

    此行为在 Chr command 的文档中定义。 :

    The returned value depends on the code page for the current thread, which is contained in the ANSICodePage property of the TextInfo class in the System.Globalization namespace. You can obtain ANSICodePage by specifying System.Globalization.CultureInfo.CurrentCulture.TextInfo.ANSICodePage.


    所以, Chr 的输出对于大于 127 的值取决于系统。如果您想要可重现的结果,请创建所需的 Encoding 实例。调用 Encoding.GetEncoding(String) ,然后使用 Encoding.GetChars(Byte())将您的数值转换为字符。
    如果您 go up one level在您问题中链接的图表中,您会看到他们并未声称该图表始终是 Chr 的输出。命令:

    The characters that appear in Windows above 127 depend on the selected typeface.

    The charts in this section show the default character set for a console application.


    您的应用程序是 WinForm 应用程序,而不是控制台应用程序。即使在控制台中,使用的字符集也可以更改(例如,通过使用 chcp 命令),因此使用“default”一词。
    有关 .net 中使用的编码的详细信息,我推荐以下 MSDN 文章: Character Encoding in the .NET Framework .

    关于vb.net 字符集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4195096/

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