Issue #7967 has been reported by coffeejunk (Maximilian Haack). ---------------------------------------- Bug #7967: String#encode invalid: :replace doesn't replace invalid chars https://bugs.ruby-lang.org/issues/7967 Author: coffeejunk (Maximilian Haack) Status: Open Priority: Normal Assignee: Category: core Target version: ruby -v: 2.0.0-p0 =begin 1.9.3p385 :001 > "\xc3\x28".encode('UTF-8', 'UTF-8', invalid: :replace) =~ /\s/ => nil 2.0.0-p0 :001 > "\xc3\x28".encode!('UTF-8', 'UTF-8', invalid: :replace) =~ /\s/ ArgumentError: invalid byte sequence in UTF-8 from (irb):1 from /Users/max/.rvm/rubies/ruby-2.0.0-p0/bin/irb:16:in `<main>' =end
on 2013-02-26 12:52
on 2013-02-26 13:31
Issue #7967 has been updated by nobu (Nobuyoshi Nakada). Status changed from Open to Rejected String#encode does nothing when source and destination encodings are same. ---------------------------------------- Bug #7967: String#encode invalid: :replace doesn't replace invalid chars https://bugs.ruby-lang.org/issues/7967#change-37097 Author: coffeejunk (Maximilian Haack) Status: Rejected Priority: Normal Assignee: Category: core Target version: ruby -v: 2.0.0-p0 =begin 1.9.3p385 :001 > "\xc3\x28".encode('UTF-8', 'UTF-8', invalid: :replace) =~ /\s/ => nil 2.0.0-p0 :001 > "\xc3\x28".encode!('UTF-8', 'UTF-8', invalid: :replace) =~ /\s/ ArgumentError: invalid byte sequence in UTF-8 from (irb):1 from /Users/max/.rvm/rubies/ruby-2.0.0-p0/bin/irb:16:in `<main>' =end
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.