views:

22

answers:

1

I am upgrading my app from rails 2 to 3 and when i 'require' this file that has an email address validator i get an 'invalid multibyte escape' error with:

dtext = '[^\\x80]' pattern = /\A#{dtext}\z/

Any thoughts?

+1  A: 

Try using:

pattern = /\A#{dtext}\z/, nil, 'n'

Check out details on encodings and regexp for more.

And I use and recommend this awesome article on encodings in Ruby.

Toby Hede