This project is archived and is in readonly mode.

#6701 new
Philippe Creux

[BUG] "\302\240".match /\w/ on ruby 1.8

Reported by Philippe Creux | April 13th, 2011 @ 11:53 PM

Hello,

"\302\240" is a UTF-8 non breaking space.

It matches /\w/ in a rails environment on ruby 1.8. This bug does not occur in a rails environment on ruby 1.9 or in irb on ruby 1.8 and ruby 1.9.

$> rails c
ruby-1.8.7-p249 > "\302\240".match /\w/
 => # MatchData "\302\240"
$> rails c
ruby-1.9.2-p0 > "\302\240".match /\w/
 => nil
$> irb
ruby-1.8.7-p249 > "\302\240".match /\w/
 => nil
$> irb
ruby-1.9.2-p0 > "\302\240".match /\w/
 => nil

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages