Project

General

Profile

Bug #10670

char-class matching same character with different encodings raises exception

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

Status:
Closed
Priority:
Normal
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

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

Associated revisions

Revision 316210b8
Added by nobu (Nobuyoshi Nakada) over 4 years ago

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 49058
Added by nobu (Nobuyoshi Nakada) over 4 years ago

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]

Revision 49058
Added by nobu (Nobuyoshi Nakada) over 4 years ago

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]

Revision 49058
Added by nobu (Nobuyoshi Nakada) over 4 years ago

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]

Revision 49058
Added by nobu (Nobuyoshi Nakada) over 4 years ago

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]

Revision 49058
Added by nobu (Nobuyoshi Nakada) over 4 years ago

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]

Revision 0a08782b
Added by naruse (Yui NARUSE) over 4 years ago

merge revision(s) 49058: [Backport #10670]

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 49264
Added by naruse (Yui NARUSE) over 4 years ago

merge revision(s) 49058: [Backport #10670]

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

History

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

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

Updated by nobu (Nobuyoshi Nakada) over 4 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 4 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 4 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.

#5

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

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

Also available in: Atom PDF