Project

General

Profile

Actions

Bug #10670

closed

char-class matching same character with different encodings raises exception

Added by gkellogg (Gregg Kellogg) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
[ruby-core:67193]

Description

The following simple script illustrates the issue:

ESCAPE_PLAIN = /\A[\x5B]*\z/m.freeze

0x5B.chr(::Encoding::UTF_8) =~ ESCAPE_PLAIN
0x5B.chr =~ ESCAPE_PLAIN

\x5B is ']', run all lines above and get in `=~': empty char-class: /\A[\x5B]*\z/m (RegexpError)

Comment out either the first or second usage and the error goes away.


Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #10382: s = '\x80'; /#{s}/ raises an exception in US-ASCII scriptClosed10/14/2014Actions
Has duplicate Ruby master - Bug #10733: Time.httpdate raises ArgumentError when DateTime.now.httpdate is provided as inputClosed01/12/2015Actions

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Related to Bug #10382: s = '\x80'; /#{s}/ raises an exception in US-ASCII script added

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Description updated (diff)
  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r49058.


re.c: append excape sequence as-is

  • re.c (unescape_nonascii): append excape sequence as-is not
    unescaped character, to get rid of unexpected meta-character.
    [ruby-core:67193] [Bug #10670]

Updated by naruse (Yui NARUSE) over 9 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE

ruby_2_2 r49264 merged revision(s) 49058.

Actions #5

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Has duplicate Bug #10733: Time.httpdate raises ArgumentError when DateTime.now.httpdate is provided as input added
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0