23 Jan
2021
23 Jan
'21
5:40 a.m.
On Fri, Jan 22, 2021, at 20:34, Inada Naoki wrote:
* Default encoding is "utf-8".
it might be worthwhile to be a little more sophisticated than this. Notepad itself uses character set detection [it might not be reasonable to do this on the whole file as notepad does, but maybe the first 512 bytes, or the result of read1(512)?] when opening a file of unknown encoding, and msvcrt's "ccs=UTF-8" option to fopen will at least detect at the presence of UTF-8 and UTF-16 BOMs [and treat the file as UTF-16 in the latter case].