Unicode algorithms for Ruby 1.9