In response to Rodrigo Rosas's message about mb_chars.upcase not
giving the expected result on 1.9, I've done some work in a fork to
make String#mb_chars always return an instance of a proxy class, both
with Ruby 1.8 and Ruby 1.9. The end result of the patch is
(hopefully) to make Rails' multibyte functionality behave the same way
in 1.8.7 and 1.9.x.
Basically, the problem is that with current edge Rails and 1.9.x,
`"café".mb_chars.upcase` will return "CAFé" rather than the expected
In my changes, the proxy class leaves some methods undefined for 1.9
because they have a native equivalent, but redefines a few others
because either they are buggy or, like String#upcase, don't have the
same behavior as AS::Multibyte::Chars.
Additionally, I refactored all of the Unicode support in ActiveSupport
into a new module, ActiveSupport::Multibyte::Unicode. This makes some
useful functionality like UTF-8
normalization/composition/decomposition easier to reuse since it's no
longer bound to the ActiveSupport::Multibyte::Chars class.
I'd be very grateful for any feedback.