The "byte" operator confusion

I tried to get byte value of a character, opened irb and this is what I
saw:

ruby-1.9.2-p180 :007 > ?a
=> “a”

I did the same at tryruby.org which responded identically.

I could swear that this morning it looked like this:

?a
=> 97

I launched Android’s Ruboto IRB (jRuby) and it was the way it should be

?a
=>97

I’ve checked google and found this:
http://www.devdaily.com/blog/post/ruby/how-convert-char-character-to-ascii-decimal-byte-ruby

I’m new to programming. What am I missing??

Cheers

Changing rvm to 1.8.7 solved the issue

ruby-1.8.7-p334 :001 > ?a
=> 97

Has ? operator changed in 1.9.2??

(I still remember this morning 1.9.2 responded well… )

Jarek N. wrote in post #1007934:

Changing rvm to 1.8.7 solved the issue

ruby-1.8.7-p334 :001 > ?a
=> 97

Has ? operator changed in 1.9.2??

Yes.

puts ‘a’.ord

–output:–
97

ascii_code = ‘a’.ord
character = ascii_code.chr
puts character

–output:–
a

7stud – wrote in post #1007936:

Jarek N. wrote in post #1007934:

Changing rvm to 1.8.7 solved the issue

ruby-1.8.7-p334 :001 > ?a
=> 97

Has ? operator changed in 1.9.2??

Yes.

Although it’s not really an operator - more a literal, which is
evaluated as the program is parsed.

For an operator (which applies to a runtime data value), try:

str[0] – ruby 1.8.x
str.ord – ruby 1.9.x

Surprisingly, String#ord doesn’t appear to have been backported to
1.8.7, although Integer#chr has.

Warning: strings in ruby 1.9 are really, really complicated. I got some
way towards reverse-engineering them, then gave up after documenting
about 200 behaviours.