alphagov/sidekiq-monitoring — pull request #7 by rboulton (2014-11-12 16:30:16+00:00)
Title: Explicitly set LC_ALL to set the locale

Without setting the locale explicitly, sidekiq-monitoring failed (with a
500 error) when trying to view jobs if the job containined any non ASCII
characters. This seems to be because ruby's JSON library assumes that
raw JSON is US-ASCII in the absence of a locale setting: specifically, I
saw:

Encoding::InvalidByteSequenceError - xE2 on US-ASCII

coming from a call to 'load_json'.

The sidekiq-monitoring processes failed to pick up the LC_ALL setting
from /etc/environment (I verified this by checking their environment
setting in /proc/PID/environ).

Setting the LC_ALL setting this way is a bit nasty, but does at least
make the thing work.