Bug #7593

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

Added by Paul McMahon over 1 year ago. Updated over 1 year ago.

[ruby-core:50998]
Status:Rejected
Priority:Normal
Assignee:-
Category:-
Target version:-
ruby -v:ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.0.0] Backport:

Description

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.

History

#1 Updated by Yui NARUSE over 1 year 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