Imports System
Imports System.Text
Imports Microsoft.VisualBasic.Strings
Class UnicodeEncodingExample
Public Shared Sub Main()
Dim uni As New UnicodeEncoding()
Dim unicodeString As String = "Pi (" & ChrW(928) & ") and Sigma (" & ChrW(931) & ")."
Dim encodedBytes As Byte() = uni.GetBytes(unicodeString)
Dim b As Byte
For Each b In encodedBytes
Console.Write("[{0}]", b)
Next b
Dim decodedString As String = uni.GetString(encodedBytes)
Console.WriteLine(decodedString)
End Sub
End Class