Module Module1 Sub Main() ' Print the header. Console.Write("Info.CodePage ") Console.Write("Info.Name ") Console.Write("Info.DisplayName") Console.WriteLine() ' Display the EncodingInfo names for every encoding, and compare with the equivalent Encoding names. Dim ei As System.Text.EncodingInfo For Each ei In System.Text.Encoding.GetEncodings() Dim e As System.Text.Encoding = ei.GetEncoding() Console.Write("{0,-15}", ei.CodePage) If ei.CodePage = e.CodePage Then Console.Write(" ") Else Console.Write("*** ") End If Console.Write("{0,-25}", ei.Name) If ei.CodePage = e.CodePage Then Console.Write(" ") Else Console.Write("*** ") End If Console.Write("{0,-25}", ei.DisplayName) If ei.CodePage = e.CodePage Then Console.Write(" ") Else Console.Write("*** ") End If Console.WriteLine() Next ei Console.ReadLine() End Sub End Module
Comments (
)
Link to this page:
//www.vb-net.com/convert/encoding.htm
|