Reimplemented update_characters in Ruby.

Now that we are using Ruby 1.9 we have the necessary Unicode support and can
get rid of the last Perl dependency.