It isn't done because it shouldn't have to be, it's more or less your
systems job to inform Ruby what your encoding preference is. Even
though I would love to say that UTF-8 is the encoding for the entire
world I can't and I can say that enforcing UTF-8 would be an
anti-pattern (to me) even if it's the preferred. If you are on Linux
or Unix read the following... if you are on Windows you are on your
own because I know about as much about Windows as actually I don't
really know much about Windows other than the lowlevel userland API's.
[9:12:55] jordon@me:~ % export LANG="en_US.BROKEN"
[9:13:00] jordon@me:~ % ruby -e 'p __ENCODING__'
[9:13:02] jordon@me:~ % export LANG="en_US.UTF-8"
[9:13:09] jordon@me:~ % ruby -e 'p __ENCODING__'
[9:14:20] jordon@me:~ % export LANG="en_US.BROKEN"
[9:14:24] jordon@me:~ % export LC_CTYPE="en_US.UTF-8"
[9:14:31] jordon@me:~ % printenv |grep -P LANG\|LC_
[9:14:50] jordon@gryffindor:~ % ruby -e 'p __ENCODING__'
Make sure LANG and/or LC_CTYPE are set.
Some applications expect LC_CTYPE some expect LANG some will expect
either or and LC_CTYPE overrides LANG.