I dont know the current status of default windows encoding, but the BOM specifies for UTF-8 and UTF-16, at least if it is UTF-8, or UTF-16 little_endian/big_endian. That can be detected via program if there are many #0 in the stream and for endianness wether the #0 are at odd/even position in the stream. Works in general.
Apparently, on mac (according to Wiki), a BOM must be written when not saved in UTF-8 or so I understood, correctly or wrongly...