From: Dave Burt Date: 2006-06-15T16:33:07+09:00 Subject: Re: A plan for another unicode string hack Leslie Viljoen wrote: > On 6/14/06, Leslie Viljoen wrote: >> On 6/14/06, Dae San Hwang wrote: >> > so that "abc"[0] returns "a" instead of fixnum 97 >> >> This behaviour - of [] returning different values depending on the >> argument has always made me a bit crazy. Does anyone know why it was >> done that way? > > ..returning different *type* values I mean.. I've heard it's due to be fixed by end of next year. Now, to Ruby's strings, a character is a byte, represented by a Fixnum. The new Ruby character will be a string: ?c #=> "c" "c"[0] #=> "c" "c"[0].ord #=> 99 Cheers, Dave