Brian Candler wrote:
> FWIW, I get 95 with irb187 under Ubuntu Dapper.
> 
> Looking at source code, the [[:print:]] character class uses isascii(c) 
> && isprint(c)
> 
> man isprint says:
> 
> NOTE
>        The  details  of  what characters belong into which class depend 
> on the
>        current locale.  For example, isupper() will not recognize an 
> A-umlaut
>        () as an uppercase letter in the default C locale.
> 
> So look at what ENV.grep(/^LC/) shows. You could try setting 
> ENV['LC_ALL']='C' in irb, or export LC_ALL=C before running it. Or try 
> 'POSIX' instead of 'C'.
> 
> Finally, be completely sure that your irb is running the right ruby. 
> Check RUBY_VERSION within irb.

1.8.7 both.

ENV.grep(/^LC/) show nothing in both irb and ruby
ENV['LC_ALL']='C' 'POSIX' etc has no effect in both

However, "echo $LC_ALL" on my prompt gives en_US.UTF-8.
So when i did LC_ALL='C', i get only 95 in both ruby and irb.

Is there any way i get can ruby to also give 191 ?
Tried ENV['LC_ALL']='en_US.UTF-8' at the start of my ruby program but it 
had no effect. Anyway, thanks for pointing this out.
-- 
Posted via http://www.ruby-forum.com/.