It should be a member function!
IO#getc returns string from 1.9 on
String#chr is present in Ruby >=1.9