Imports System
Imports System.Text
Imports Microsoft.VisualBasic.Strings
Class EncoderExample
Public Shared Sub Main()
' ChrW(928) = Pi ChrW(931) = Sigma
Dim chars() As Char = { ChrW(928), ChrW(931)}
Dim uniEncoder As Encoder = Encoding.Unicode.GetEncoder()
Dim byteCount As Integer = uniEncoder.GetByteCount(chars, 0, chars.Length, True)
Console.WriteLine(byteCount)
End Sub
End Class