James Cooke Blog

Blog of tech and random.

geek fix : cron locale breaking subversion client

Working on an automatic subversion cron script that called svn to run some basic add / delete / commit functions and I ran into the standard error when running from cron but not from the command line with bash:

Can’t convert string from native encoding to ‘UTF-8’

The problem is documented way back in 2006 here.

It’s due to two things : how svn uses locales and how cron defaults to POSIX locale on ubuntu.

Proposed solutions are here and here. I chose to jack the following into my bash script:

export LANG=en_GB.utf8

Probably not even 100% correct, but it works.