I have a nvarchar(256) field in a SQL 2005 database table that contains several records in Chinese and I'd like to output this characters correctly in VB.NET code.
What I have now doesn't work at all:
Dim MyText As String = "推荐评论: 属于那~种类型的电影"
Dim value As [String] = MyText
Dim tc As Encoding = Encoding.GetEncoding(950)
Dim bytes As Byte() = tc.GetBytes(value)
value = Encoding.Unicode.GetString(bytes)
Console.WriteLine(value + vbCrLf)
MyText string is the Chinese language coming from the db field so no problems there. My problem is how to display "MyText" correctly. What is the right way to do this? I'm using a simple console app to do the test.
Thanks.