Fixes potential encoding issues.

This encoding thing really is very annoying. Wouldn't it be time for windows
to give up and join then utf-8 side?