On Dec 27, 11:06  
> On Mon, Dec 27, 2010 at 8:12 PM, Intransition <transf... / gmail.com> wrote:
> > Any way to peek at the first character of $stdin without actually
> > consuming it?

I assume you don't want to look at the first char as soon as it's
typed

> What about IO#getc and IO#ungetc.

On versions < 1.9 these will only read bytes, regardless of $KCODE.

What's a reasonable alternative, $stdin.readline.chars.to_a[0] ?