Sniffing the encoding should be aware of multi-byte characters.  Fixes issue #37.