Locales

Mysteries of system administration ...

You have two servers, you have the same scripts available on the two servers. The scripts are run via 'crontab', which has the same version on both servers. They have the same operating system. The scripts use 'perl', which is the same version on both servers. Script works on both servers, but throws locale warnings on server B. In the end, the solution was to edit /etc/environment (deprecated). Somehow crontab still uses this file, and the file was empty on the working server, and set to an old (also deprecated) charset on the other.
Read more