Fix encoding issue for platforms that default encoding is not UTF-8.