use chardet to guess file string encoding

in the function guess_encoding you use `magic.buffer`. This returns a mime type:`'text/plain'` rather than utf8 for my signature.
I'm not an expert on python string encoding, but with `chardet.decode` I correctly get utf8.