Fix encoding issues, esp. with CLI tool