On Wed, Dec 26, 2012 at 6:28 PM, Shiv Deepak <[email protected]> wrote: > I was working on my web app while this bug > (https://github.com/rails/rails/issues/4259) was giving me hard time. So I > decided to try fixing it myself. I cloned rails from github; while doing > bundle install I was facing some unicode encoding issues, stack trace: > https://gist.github.com/raw/4384230/9d174ae0aa3f4f32302f7c9af9d08d5dd44ba0a2/gistfile1.sh > > I did a quick google search and ended up with this post: > http://stackoverflow.com/questions/7095845/when-run-bundle-get-invalid-byte-sequence-in-us-ascii > on stack overflow > > As it fixed issue with `bundle install` at my local dev environment, it made > me wonder why is it not already done. So, I quickly created a branch and > pushed it to my forked rails repository. > > diff: https://github.com/idlecool/rails/compare/bundler_encoding > > This seems to be very trivial issue, but not fixed. I was going to make a > pull request but decided to post it here instead for more clarity. Should I > go ahead and make a pull request or is there something wrong with my local > ruby/rvm installation.
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__' #<Encoding:US-ASCII> [9:13:02] jordon@me:~ % export LANG="en_US.UTF-8" [9:13:09] jordon@me:~ % ruby -e 'p __ENCODING__' #<Encoding:UTF-8> [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_ LANG=en_US.BROKEN LC_CTYPE=en_US.UTF-8 [9:14:50] jordon@gryffindor:~ % ruby -e 'p __ENCODING__' #<Encoding:UTF-8> Make sure LANG and/or LC_CTYPE are set. LC_CTYPE="en_US.UTF-8" LANG="en_US.UTF-8" Some applications expect LC_CTYPE some expect LANG some will expect either or and LC_CTYPE overrides LANG. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

