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 about 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

Also available in: Atom PDF

Like0
Like0Like0