Bug #563

Regexp::escape is not Encoding Aware

Added by James Gray almost 7 years ago. Updated about 4 years ago.

[ruby-core:18584]
Status:Closed
Priority:Normal
Assignee:Yui NARUSE
ruby -v: Backport:

Description

=begin
Escaping an encoded String can damage the encoding:

s = "+"
=> "+"
s.encode!("UTF-16BE")
=> "\x00+"
re = Regexp.escape(s)
=> "\+"
re.encoding
=> #Encoding:UTF-16BE
=end

History

#1 Updated by Koichi Sasada almost 7 years ago

  • Assignee set to Yui NARUSE

=begin

=end

#2 Updated by Koichi Sasada almost 7 years ago

  • Status changed from Open to Closed

=begin

=end

Also available in: Atom PDF