English 中文(简体)
Unicode 在 vb.net 中
原标题:
  • 时间:2009-03-07 04:55:47
  •  标签:
问题回答

您是否正在使用vbUnicode将字节数组转换为字符串? 就像以下这样?

StrConv(ByteArray, vbUnicode)

如果是这样的话,这是该函数的 .Net 等效版本。

Dim theString as String = System.Text.Encoding.Unicode.GetString(ByteArray)

在.NET中(因此也在VB.NET中),所有字符串都是Unicode编码的。.NET还有库可输出不同格式的字符串(参见System.Text.Encoding类及相关类)。你具体想用Unicode做什么?

VB 6不支持Unicode,至少不是直接支持的。有办法绕过去,但操作起来非常麻烦。如果你问VB 6是否像VB.NET那样支持Unicode,答案是否定的。

If, instead, you are asking whether or not you can use something like code pages in VB.NET, the answer is an indirect yes, although I see no reason to jump through that hoop to support globalization/localization, as the paradigm has shifted.





相关问题
热门标签