Actions
Bug #172
closedRegular expressions should inherit encoding of context even if they only contain 7-bit chars
Description
=begin
The following program fails:
encoding: utf-8¶
"∂y/∂x = 2x" =~ /\p{Greek}/
with "t.rb:2: invalid character property name {Greek}: /\p{Greek}/"
The reason is that the regexp has US-ASCII encoding, and in that encoding the property 'Greek' is not defined.
However, in this case, that's very unexpected behavior. I'd suggest that if a regular expression is US-ASCII, but is being compared to a string that is not US-ASCII, the regular expression should temporarily take on the same encoding as the string.
Dave
=end
Updated by Anonymous over 16 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r17882.
=end
Actions
Like0
Like0