utf-8 and Ruby 1.8/1.9
Brought to you by:
kwatch
With Ruby 1.8, non-ascii characters are accepted in unquoted strings. With Ruby 1.9, the strings must be quoted else you get a "document end expected (maybe invalid tab char found). (Kwalify::SyntaxError)"
This is because \w has changed its meaning:
"uéa" =~ /(\w+)/; $1
# -> "uéa" in 1.8
# -> "u" in 1.9
\w should be replaced by \p{Word} or similar.
After a quick test, changing all \w with \p{Alnum} and adding u for all modified regexs (/…\w…/ → /…\p{Alnum}…/u).works with Ruby 1.9.3. Unfortunately, it’s not compatible with 1.8.7...