UTF-8 encoding of Unicode characters. : UTF8Encoding « Internationalization I18N « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Internationalization I18N » UTF8EncodingScreenshots 
UTF-8 encoding of Unicode characters.
 

Imports System
Imports System.Text
Imports Microsoft.VisualBasic.Strings

Class UTF8EncodingExample

    Public Shared Sub Main()
        Dim utf8 As New UTF8Encoding()
        Dim unicodeString As String = "Pi (" & ChrW(928") and Sigma (" & ChrW(931")."
        Console.WriteLine(unicodeString)

        Dim encodedBytes As Byte() = utf8.GetBytes(unicodeString)
        Dim As Byte
        For Each b In  encodedBytes
            Console.Write("[{0}]", b)
        Next b
        Dim decodedString As String = utf8.GetString(encodedBytes)
        Console.WriteLine(decodedString)
    End Sub
End Class

   
  
Related examples in the same category
1.Calculates number of characters produced by decoding a sequence of bytes from the specified byte array.
2.Decodes a sequence of bytes from the specified byte array into the specified character array.
3.Obtains a decoder that converts a UTF-8 encoded sequence of bytes into a sequence of Unicode characters.
4.Encoding.UTF8
5.Create UTF8Encoding class
6.Create UTF8Encoding class.
7.UTF8Encoding.Equals
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.