Re: Library function to detect UTF-8 streams without BOM

"marek jedlinski" <marekjed@xxxxxxxxxxxxxxxxx> wrote in message

I've been testing several Unicode-capable shareware editors for
Windows (can't find one that's quite right for my work), and none
has any problems detecting BOM-less UTF-8, even in non-xml/html
files, where they cannot rely on the encoding specified in the file

Unless the encoding is specified by a BOM or explicitally (and accurately)
inside the content, then it has to be determined by analyzing the format of
the content and making guesses about what encoding might be used. There are
some blogs about this in MSDN that describe how Notepad tries to auto-detect
the encoding, for instance:

Some files come up strange in Notepad

The Notepad file encoding problem, redux