Fix encoding issues on Mac