0

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?

Arafangion
  • 11,517
  • 1
  • 40
  • 72
dgo.a
  • 2,634
  • 23
  • 35

1 Answers1

0

No, unless I'm mistaken, setting:

# encoding: UTF-8

Only sets the source encoding for that file.

Setting:

export LANG="en_US.UTF-8"

Only sets the default external encoding.

Ruby 1.9 has internal, source, and external encodings.

Arafangion
  • 11,517
  • 1
  • 40
  • 72