EncodingHeuristics reads from a stream
(which should be buffered) and attempts to guess
what the encoding of the text in the stream is.
Byte order marks are stripped from the stream.
If it fails to determine the type of the encoding,
it returns the default UTF-8.