Created
February 17, 2012 00:09
-
-
Save rafacv/1849043 to your computer and use it in GitHub Desktop.
IronRuby doesn't respect encoding comments when eval'ing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval <<ENC | |
# coding: utf-8 | |
def method | |
puts "".encoding.inspect | |
end | |
ENC | |
eval <<ENC | |
# coding: big5 | |
def method2 | |
puts "".encoding.inspect | |
end | |
ENC | |
eval <<ENC | |
# coding: shift_jis | |
def method3 | |
puts "".encoding.inspect | |
end | |
ENC | |
method | |
method2 | |
method3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby encoding.rb | |
#<Encoding:UTF-8> | |
#<Encoding:Big5> | |
#<Encoding:Shift_JIS> | |
$ ir encoding.rb | |
#<Encoding:US-ASCII> | |
#<Encoding:US-ASCII> | |
#<Encoding:US-ASCII> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment