From: "naruse (Yui NARUSE)" Date: 2012-12-21T12:27:42+09:00 Subject: [ruby-core:51019] [ruby-trunk - Bug #7593][Rejected] File encoding needs to be specified when using {Katakana} character property Issue #7593 has been updated by naruse (Yui NARUSE). Status changed from Open to Rejected On 1.9.3, default source encoding is US-ASCII. Regexp escape \p{foo} in US-ASCII is interpreted as POSIX character class foo. In this case, US-ASCII doesn't have POSIX character class Katakana, so this will raise error. On 2.0.0, default source encoding becomes UTF-8. So this won't happen. ---------------------------------------- Bug #7593: File encoding needs to be specified when using {Katakana} character property https://bugs.ruby-lang.org/issues/7593#change-34921 Author: pwim (Paul McMahon) Status: Rejected Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.0.0] Creating a file with only the following line in it: /\p{Katakana}/ will raise the error katakana.rb:1: invalid character property name {Katakana}: /\p{Katakana}/ This can be resolved by specifying # encoding: UTF-8 However, it was not obvious to me that this was needed. -- http://bugs.ruby-lang.org/