vb.net字符集

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

>我错过了什么?为什么它说它使用一个并使用另一个?
>我做错了什么?
>原始字符集是否有某种转换工具?

解决方法

此行为在 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.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.

相关文章

Format[$] ( expr [ , fmt ] ) format 返回变体型 format$ 强...
VB6或者ASP 格式化时间为 MM/dd/yyyy 格式,竟然没有好的办...
在项目中添加如下代码:新建窗口来显示异常信息。 Namespace...
转了这一篇文章,原来一直想用C#做k3的插件开发,vb没有C#用...
Sub 分列() ‘以空格为分隔符,连续空格只算1个。对所选...
  窗体代码 1 Private Sub Text1_OLEDragDrop(Data As Dat...