sigmavirus24/charade — pull request #19 by joetsoi (2013-06-05 12:42:18+00:00)
Title: detect as UTF16/32 when BOM is found

Currently anything with a UTF BOM gets detected as UTF16-BE or UTF16-LE, which is true but strictly a BOM should not be present in UTF16-BE or UTF16-LE see wiki [here](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-16) and [here](http://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes).

This means that when you use [str.decode](http://docs.python.org/2/library/codecs.html), it'll leave in the BOM at the beginning of the decoded unicode string, which can break things like xml parsers.

Not sure the best way to handle this, this pull requests returns UTF-16, but you could also return UTF16-LE and remove the BOM in the output.