Skip to content

String#* is not encoding aware #2056

Closed
yob opened this Issue Nov 26, 2012 · 1 comment

2 participants

@yob
yob commented Nov 26, 2012

Here's a test script

⚡ cat foo.rb 
# coding: utf-8

str_one = "写中国字"
puts str_one
puts str_one.encoding

str_two = "写中国字" * 10
puts str_two
puts str_two.encoding

Versions:

⚡ ruby1.9.1 -v
ruby 1.9.3p327 (2012-11-10) [x86_64-linux]

⚡ rbx -v
rubinius 2.0.0rc1 (1.9.3 bd640ab8 2012-11-02 JI) [x86_64-unknown-linux-gnu]

And the output:

⚡ ruby1.9.1 foo.rb
写中国字
UTF-8
写中国字写中国字写中国字写中国字写中国字写中国字写中国字写中国字写中国字写中国字
UTF-8

⚡ rbx foo.rb 
写中国字
UTF-8
写中国字写中国字写中国字写中国字写中国字写中国字写中国字写中国字写中国字写中国字
ASCII-8BIT
@brixen
Rubinius member
brixen commented Nov 26, 2012

Please use master HEAD to test. This was fixed in a8a9a00

@brixen brixen closed this Nov 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.