Bug #3884: rake does not respect LC_* vars for encoding
http://redmine.ruby-lang.org/issues/show/3884

Author: Caio Chassot
Status: Open, Priority: Normal
ruby -v: ruby 1.9.2p0 (2010-08-18 revision 29034) [universal.x86_64-darwin10.4.0]

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29034) [universal.x86_64-darwin10.4.0]

$ export -n LC_ALL LC_CTYPE LANG
$ ruby -e "puts __ENCODING__"
US-ASCII

$ LC_ALL="en_US.UTF-8" ruby -e "puts __ENCODING__"
UTF-8

$ echo "task(:foo) { puts __ENCODING__ }" > Rakefile
$ rake -s foo
US-ASCII

$ LC_ALL="en_US.UTF-8" rake -s foo
US-ASCII


Same for current trunk:

$ ./ruby -v
ruby 1.9.3dev (2010-09-28 trunk 29354) [universal.x64-darwin10.4.0]

$ export -n LC_ALL LC_CTYPE LANG
$ ./ruby -e "puts __ENCODING__"
US-ASCII

$ LC_ALL="en_US.UTF-8" ./ruby -e "puts __ENCODING__"
UTF-8

$ echo "task(:foo) { puts __ENCODING__ }" > Rakefile
$ ./bin/rake -s foo
US-ASCII

$ LC_ALL="en_US.UTF-8" ./bin/rake -s foo
US-ASCII


A magic comment on the Rakefile will work, tho.


----------------------------------------
http://redmine.ruby-lang.org