When trying to import a textfile which is encoded with UTF-8 I can't get it right. I do use a schema.ini and OLEDB but the schema.ini is ignored.
The case: I have a textfile, UTF-8 encoded. I need to import this textfile with VB.NET into a datatable. To do this I use a schem.ini file:
[UTF8.txt]
format=Delimited(;)
colnameheader=true
maxscanrows=0
CharacterSet=65001
The characterset should make it work but instead of a nice Fërry I see something like Férry.
The whole trick was too simple to keep it to myself. By default, my code wrote the schema.ini in..... UTF-8... So adding an encoding-type to the write statement was all I needed to do :)
My.Computer.FileSystem.WriteAllText(SchemaFile, SchemaTemplate, False, System.Text.ASCIIEncoding.ASCII)