I have to write a textfile in VB6. I need to do it in appending and utf-8 encoded.
I tried two solutions, one with \"TextStream\" and another one with \"ADODB.Stream
I prefer to save it ANSI as it does by default. Open it with a notepad and overwrite it selecting UTF8 encoding. I found it's the fastest way by far. And I use some other code to append, for example for a database convertion:
Dim fs As Object, a
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(filename, True) 'example (myfile.xml, True)
a.writeline var1
a.writeline var2
a.Close