Wrong charset for cron

I got a issue on a export job i had that was running daily on which the charset of the data exported wer wrong, and this did not happen when i ran the job manually. I noticed that Cron used the charset “POSIX” instead of en_US.UTF-8 which i used. I fixed this by adding “LANG=en_US.UTF-8” to the fileĀ /etc/default/locale.

It appears that when the LANG variable is not set in that file, Cron will fall back to using the POSIX charset.