Fix crash in logging when filename contains non-ascii characters.
Merge pull request #240 from olofsj/fix_unicode_errors

Fix crash in logging when filename contains non-ascii characters.