Project

General

Profile

Actions

Bug #7967

closed

String#encode invalid: :replace doesn't replace invalid chars

Added by coffeejunk (Maximilian Haack) about 11 years ago. Updated about 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.0.0-p0
Backport:
[ruby-core:52935]

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


Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #6321: Find and repair bad bytes in encodings, without transcodingClosednaruse (Yui NARUSE)04/19/2012Actions
Related to Ruby master - Feature #6752: Replacing ill-formed subsequencceClosedmatz (Yukihiro Matsumoto)07/19/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0