Skip to content

String#encode with undef replace options problem #881

@seban

Description

@seban

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions