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
Actions
Like0
Like0