Fix a bug that error report is failed

If locale encoding is different with source code encoding, error report
is failed. For example, locale encoding is Windows-31J and source code
encoding is UTF-8.

GitHub: fix #87

Reported by scivola. Thanks!!!