Improve encoding guess process for UTF-8 input

GitHub: fix #34

Reported by Colin Dean. Thanks!!!