Bug #3884
closedrake does not respect LC_* vars for encoding
Description
=begin
$ 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.
=end
Updated by nobu (Nobuyoshi Nakada) about 14 years ago
- Status changed from Open to Rejected
=begin
LC_* vars only affect the source encoding of -e option, but not of script file.
$ echo 'puts ENCODING' > enc.rb
$ LC_ALL=ja_JP.utf-8 ruby enc.rb
US-ASCII
$ LC_ALL=ja_JP.utf-8 ruby -e 'puts ENCODING'
UTF-8
=end