Fixes encoding issues with non-ascii characters.