Actions
Bug #7967
closedString#encode invalid: :replace doesn't replace invalid chars
Description
=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 `'
=end
Updated by nobu (Nobuyoshi Nakada) almost 12 years ago
- Status changed from Open to Rejected
String#encode does nothing when source and destination encodings are same.
Actions
Like0
Like0