LoadTextW and Unicode encoding

General TRichView support forum. Please post your questions here
Post Reply
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

LoadTextW and Unicode encoding

Post by martindholmes »

Hi there,

The documentation for LoadTextW says:
For LoadTextW:
File must be in Unicode encoding.
My question is: what constitutes Unicode encoding? A Unicode text file could be in UTF-16 BE or UTF-16 LE; the byte order mark will reveal this. However, UTF-8, the most commonly-used Unicode encoding, does not normally have a byte-order mark.

Does LoadTextW recognize and load UTF-8 without a BOM?

Cheers,
Martin
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

LoadTextW cannot load UTF-8.
It loads UTF-16 files. LE is implied, BE is supported if specified by BOM.
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

OK, I guess I'll have to try to auto-detect UTF-8 then. I've written some code for doing that in the past.

Cheers,
Martin
Post Reply