Search notes:

ADODB: stream.loadFromFile

charCode

Unfortunatly, Visual Basic for Application doesn't seem to have any in-built capabilities to read (or write) UTF-8 encoded text (see also here).
However, with the ADODB stream object, a utf-8 encoded file can be read as demonstrated in the following example.
The value of adodb.stream.charSet apparently can be set to any value found in the registry under HKEY_CLASSES_ROOT\MIME\Database\Charset.
In order for this example to compile, the ActiveX Data Objects reference needs to be added.
option explicit

sub main() ' {

    dim s as new adodb.stream
    s.charSet = "utf-8"

    s.open
    s.loadFromFile(environ$("userprofile") & "\utf-8.txt")

    dim txt as string
    txt = s.readText

    s.close

    debug.print(txt)

end sub ' }
Github repository about-adodb, path: /objects/stream/loadFromFile/charCode.bas

See also

The function slurpFileCharSet() in the VBA helper module File.bas
VBA strings: special characters

Index