[LRUG] out of char range (RangeError)

Thomas R. Koll tomk32 at gmx.de
Thu Feb 14 11:07:03 PST 2008


Am 14.02.2008 um 16:52 schrieb aidy lewis:
>
> c:/ruby/lib/ruby/site_ruby/1.8/gmailer.rb:401:in `chr': 9660 out of  
> char range (RangeError)
>
> The offending line of code is:
>
> when /\A#(\d+)\z/n         then Integer($1).chr
>
> Could anyone suggest a fix?



Characters? Sure you use ruby? ;-)

I had a look at Integer#char and that's where the RangeError comes from:
     if (i < 0 || 0xff < i)
         rb_raise(rb_eRangeError, "%ld out of char range", i);
So, Integer.char(i) works only if i is an ASCII and you seem to have  
unicode.

About fixing, I don't know, sorry.

ciao, tom


--
Thomas R. "TomK32" Koll || http://tomk32.de || http://ananasblau.com  
(NEW)
just a geek trying to change the world
Skype: TomK32 || Mail: tomk32 at gmx.de




More information about the Chat mailing list