I had a Ruby script giving me an invalid multibyte char (US-ASCII) error. It turns out the server's $LANG env variable was not being set. Once I set it to en_US.UTF-8, the error went away.
Does this mean export LANG="en_US.UTF-8" is equivalent to putting # encoding: UTF-8 on every file?
No, unless I'm mistaken, setting:
Only sets the source encoding for that file.
Setting:
Only sets the default external encoding.
Ruby 1.9 has internal, source, and external encodings.