Perform the conversion from one encoding to the other
Imports System
Imports System.Text
Imports Microsoft.VisualBasic
Namespace Convert_Example
Class MyConvertExampleClass
Shared Sub Main()
Dim unicodeString As String = " Pi:" & ChrW(&H03A0)
Dim ascii As Encoding = Encoding.ASCII
Dim [unicode] As Encoding = Encoding.Unicode
Dim unicodeBytes As Byte() = [unicode].GetBytes(unicodeString)
Dim asciiBytes As Byte() = Encoding.Convert([unicode], ascii, unicodeBytes)
End Sub
End Class
End Namespace
Related examples in the same category