Project

General

Profile

Actions

Bug #7593

closed

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

Added by pwim (Paul McMahon) over 11 years ago. Updated over 11 years ago.

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

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.

Updated by naruse (Yui NARUSE) over 11 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.

Actions

Also available in: Atom PDF

Like0
Like0