Personally, I don't want that behaviour. If I don't have a
UTF-8-flavoured locale set, I want the software to respect that
fact.
Unfortunately, a certain popular OS does not _allow_ the user to select
a UTF-8-flavored locale. IIRC, that OS also happens to be where the
proliferation of "UTF-8 BOM"s started, though due to an unrelated issue.
(I'm talking about Windows, of course. While it's now possible to
programmatically select CP_UTF8 for character-encoding conversions,
there is still no way to set it as the user's default.)
I've not come across it often, but every time it's been a pain, one
way or another. Maybe your mileage has been different, but I would
rather not see it inserted by any software.
It's not perfect, but in my experience it solves more problems than it
causes, particularly on a certain OS. YMMV.
It's certainly less common in the Unix world, but that's primarily
because most Unix software assumes UTF-8 by default anyway. That's
certainly a lot simpler than the mess that Microsoft has created.
It causes problems even with software that does understand UTF-8.
Modern grep understands UTF-8, but grep ^# will miss a #include if a
C file starts with a ZWNBSP. Maybe the file is a list of files to
tar, or to pass to xargs or to... you name it, most likely the ZWNBSP
will make it go wrong.
AFAIK, those programs _don't_ really understand UTF-8; they just deal
with strings of arbitrary bytes, and UTF-8 "just works" with little or
no code change required, which is again why it's so popular.
Yes, a "UTF-8 BOM" does sometimes cause problems, but a UTF-16 (or
UTF-32) BOM probably will as well in the same cases, if they're
supported at all. They're often not, since they require substantial
code changes to convert all your char strings to wchar strings, use
wcs*() rather than str*(), etc.
S