[MacRuby-devel] [macruby] #94: Bug with non-ASCII in the regular expressions

macruby ruby-noreply at macosforge.org
Sat Jul 5 22:22:12 PDT 2008


#94: Bug with non-ASCII in the regular expressions
----------------------------------------+-----------------------------------
 Reporter:  vincent.isambart at gmail.com  |       Owner:  lsansonetti at apple.com
     Type:  defect                      |      Status:  new                  
 Priority:  blocker                     |   Milestone:                       
Component:  MacRuby                     |    Keywords:                       
----------------------------------------+-----------------------------------
 The following code source displays correctly "あ" in both 1.9 and 1.8 but
 it wrongly displays "" in MacRuby. I think the reason is that the regexps
 created with Oniguruma are always created with an ASCII encoding in
 MacRuby (shouldn't it be UTF-8 as all source code files are handled as
 UTF-8?).

 # encoding: utf-8
 version = RUBY_VERSION.sub(/(\d+\.\d+)\.\d+/, '\1').to_f
 $KCODE = 'u' if version <= 1.8 # remove the warning we get in 1.9 for
 using $KCODE
 m = /あ/.match('あ')
 p m[0]

-- 
Ticket URL: <https://www.macruby.org/trac/ticket/94>
macruby <http://macruby.org/>


More information about the MacRuby-devel mailing list