davidtysman/writetheman — pull request #1 by mibamur (2014-07-16 13:53:01+00:00)
Title: il8n

Regular Expression Encoding multibyte Rules
https://github.com/davidtysman/railstheman/issues/1
First, you can append encoding switch to regexp string. There are 4 switches (/u, /n, /e, /s) and default encoding is US-ASCII.

1.9.2-p290 :026 > /a/.encoding => Encoding:US-ASCII
1.9.2-p290 :024 > /a/u.encoding => Encoding:UTF-8
1.9.2-p290 :025 > /a/n.encoding => Encoding:US-ASCII
1.9.2-p290 :027 > /a/e.encoding => Encoding:EUC-JP
1.9.2-p290 :028 > /a/s.encoding => Encoding:Windows-31J