Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String#encode with undef replace options problem #881

Closed
seban opened this Issue Jul 12, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@seban
Copy link

seban commented Jul 12, 2013

I am now switching my app from old jruby-1.6.8 to new 1.7.4 but I have issue with String#encode method.

1.9.3p385 :003 > "Pojemność".encode(Encoding::US_ASCII, { :undef => :replace, :replace => ""})
 => "Pojemno"

2.0.0p247 :002 > "Pojemność".encode(Encoding::US_ASCII, { :undef => :replace, :replace => ""})
 => "Pojemno"

jruby-1.6.8 :001 >
jruby-1.6.8 :001 > "Pojemność".encode(Encoding::US_ASCII, { :undef => :replace, :replace => ""})
 => "Pojemno"

jruby-1.7.0 :001 > "Pojemność".encode(Encoding::US_ASCII, { :undef => :replace, :replace => ""})
 => "Pojemno??"

jruby-1.7.4 :001 > "Pojemność".encode(Encoding::US_ASCII, { :undef => :replace, :replace => ""})
 => "Pojemno??"

It looks like :replace option is totally not used in this method. Is it not supported in Jruby 1.7 branch or I just doing something wrong?

@lowang

This comment has been minimized.

Copy link

lowang commented Jul 12, 2013

problems is also visible in 1.7.1, 1.7.2 & 1.7.3

@headius

This comment has been minimized.

Copy link
Member

headius commented Jul 12, 2013

Fixing.

@lowang

This comment has been minimized.

Copy link

lowang commented Jul 12, 2013

wow, thanks for super fast response 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.