Bug #2500
closed\c before a unicode character should cause an error
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
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
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