Project

General

Profile

Actions

Bug #2500

closed

\c before a unicode character should cause an error

Added by coatl (caleb clausen) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.1p376 (2009-12-07 revision 26040 [x86_64-linux]
Backport:
[ruby-core:27228]

Description

=begin
In a double-quoted string, no error occurs if the control escape ('\c' or '\C-') precedes an escaped unicode character (using the \uXXXX syntax). I would expect an error, as unicode characters (generally) don't have meaningful 'controlled' versions.
For example, this:
"\c\u5555"
should cause an error. Instead, the second backslash appears to be ignored. In other words, it parses the same way as this:
"\cu5555"

If a literal unicode character appears after \c, that causes an error, as I would expect. For instance:
"\cΔ"
is a syntax error.

I have observed this in recent 1.9.1 builds; I don't have a 1.9.2 handy to test with.
=end

Actions #1

Updated by naruse (Yui NARUSE) over 14 years ago

  • Category set to core
  • Status changed from Open to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)

=begin
This also affects Ruby 1.9.
=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 14 years ago

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

=begin
This issue was solved with changeset r27507.
caleb, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0