Fix encoding issue in rake task

Fails when LANG etc env vars aren't set.