Project

General

Profile

Actions

Bug #563

closed

Regexp::escape is not Encoding Aware

Added by JEG2 (James Gray) about 13 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
Backport:
[ruby-core:18584]

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

Actions #1

Updated by ko1 (Koichi Sasada) about 13 years ago

  • Assignee set to naruse (Yui NARUSE)

=begin

=end

Actions #2

Updated by ko1 (Koichi Sasada) about 13 years ago

  • Status changed from Open to Closed

=begin

=end

Actions

Also available in: Atom PDF