Calculates number of characters produced by decoding a sequence of bytes from the specified byte array. : UTF8Encoding « Internationalization I18N « VB.Net






Calculates number of characters produced by decoding a sequence of bytes from the specified byte array.

 

Imports System
Imports System.Text
Imports System.Net.Sockets
Class UTF8EncodingExample

    Public Shared Sub Main()
        Dim bytes() As Byte = { _
            85,  84,  70,  56,  32,  69, 110, _
            69, 120,  97, 109, 112, 108, 101 _
        }

        Dim utf8 As New UTF8Encoding()
        Dim charCount As Integer = utf8.GetCharCount(bytes, 2, 8)
        Console.WriteLine(charCount)
    End Sub 
End Class 

   
  








Related examples in the same category

1.Decodes a sequence of bytes from the specified byte array into the specified character array.
2.Obtains a decoder that converts a UTF-8 encoded sequence of bytes into a sequence of Unicode characters.
3.Encoding.UTF8
4.UTF-8 encoding of Unicode characters.
5.Create UTF8Encoding class
6.Create UTF8Encoding class.
7.UTF8Encoding.Equals