Author vstinner
Recipients benjamin.peterson, gz, poolie, r.david.murray, vstinner
Date 2011-12-21.00:26:02
SpamBayes Score 2.85874e-05
Marked as misclassified No
Message-id <1324427163.71.0.811977840615.issue13643@psf.upfronthosting.co.za>
In-reply-to
Content
> There are two problems with this: one is just the practical
> one that it scales poorly to have to tell every user to do this
> and to take them through working out how to set this in a way
> that covers cron jobs, daemons, things run over ssh, etc.

I never checked which locale is used by default for programs called by cron. So I checked: on Fedora 16, programs start with a very few environment variables, and LANG and LC_ALL are not set. You can add "LANG=fr_FR.UTF-8" (for example) to /etc/environment to set the default language for the whole system (for all programs). I checked, it works with cron. Or if you don't want to affect all programs, it is maybe safer to only set the locale for one specific program in your crontab by adding "LANG=fr_FR.UTF-8 " before you command. Example:

* *  *  *  * LANG=fr_FR.UTF-8 /home/haypo/test.sh

--


If you want to handle any filename without having to care of the locale, the simplest solution is to use the bytes type to store filenames.
History
Date User Action Args
2011-12-21 00:26:03vstinnersetrecipients: + vstinner, benjamin.peterson, r.david.murray, gz, poolie
2011-12-21 00:26:03vstinnersetmessageid: <1324427163.71.0.811977840615.issue13643@psf.upfronthosting.co.za>
2011-12-21 00:26:03vstinnerlinkissue13643 messages
2011-12-21 00:26:03vstinnercreate