Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

October 19, 2007

How to Read a utf-8 File into a VB.NET String

This code demonstrates how to load a file containing utf-8 encoded characters into a VB.NET string:

        Dim fileBytes As Byte()
	
        ' This file contains utf-8 encoded Japanese text.
        fileBytes = System.IO.File.ReadAllBytes("japaneseUtf8.txt")
	
        Dim s As String
        s = System.Text.Encoding.UTF8.GetString(fileBytes)
	
        MsgBox(s)
	


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.