Re: Reading text files with UTF-8 byte order mark
- From: "ekkehard.horner" <ekkehard.horner@xxxxxxxx>
- Date: Fri, 02 May 2021 20:37:58 +0200
FriendOfBOB schrieb:
I have a simple VBA application that reads text files using an ADO 2.x library. The application that creates the text file has been "enhanced" to support Unicode, and now places a UTF-8 byte order mark (BOM) as the first three characters of the file ... , hex values EF BB BF. ADO 2.x doesn't seem to "speak" Unicode, and doesn't interpret these characters as a BOM. Instead, the three characters are include in the first row, first field value ... a field name in my case.
All I can find is an ANSI versus OEM setting in the schema.ini file. Am I missing something, or does ADO 2.x reading text files simply not support Unicode?
While you can set the CharacterSet key in the schema.ini file to any
valid encoding (try 1200 for utf-16 or 65001 for utf-8), both the
OLEDB and the ODBC Text driver choke on the utf-8 bom in the first
line.
You may put an (misleading) ColNameHeader=True in the schema.ini, if
your VBA application can write headers or dummies to the first row.
.
- Follow-Ups:
- Re: Reading text files with UTF-8 byte order mark
- From: FriendOfBOB
- Re: Reading text files with UTF-8 byte order mark
- References:
- Reading text files with UTF-8 byte order mark
- From: FriendOfBOB
- Reading text files with UTF-8 byte order mark
- Prev by Date: Re: How to create a checkbox datatype column in a table in VB .net code
- Next by Date: PROPVARIANT tags in data row of recordset XML
- Previous by thread: Reading text files with UTF-8 byte order mark
- Next by thread: Re: Reading text files with UTF-8 byte order mark
- Index(es):
Relevant Pages
|