Bug #7593

File encoding needs to be specified when using {Katakana} character property

Added by Paul McMahon almost 3 years ago. Updated almost 3 years ago.

ruby -v:ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.0.0] Backport:


Creating a file with only the following line in it:


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.


#1 Updated by Yui NARUSE almost 3 years ago

  • 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.

Also available in: Atom PDF