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