title: Ruby 1.9: how can I properly upcase & downcase multibyte strings?
body: <p>So matz made the decision to keep <code>upcase</code> and <code>downcase</code> limited to <code>/[A-Z]/i</code> in ruby 1.9.1.</p>
  
  <p><code>ActiveSupport::Multibyte</code> has long had great i18n case jiggering in ruby 1.8.x via <code>String#mb_chars</code>.</p>
  
  <p>However, when tried under ruby 1.9.1, it doesn't seem to work. Here's a simple test script I wrote, along with the output I'm getting:</p>
  
  <pre><code>$ cat test.rb
  # encoding: UTF-8
  
  puts("@ #{RUBY_VERSION} " + (__ENCODING__ rescue $KCODE).to_s)
  sd, su = "Iñtërnâtiônàlizætiøn", "IÑTËRNÂTIÔNÀLIZÆTIØN"
  def ps(u, d, k); puts "%-30s:  %24s / %-24s" % [k, u, d] end
  ps sd.upcase, su.downcase, "Plain ruby"
  
  require 'rubygems'; require 'active_support'
  ps sd.upcase, su.downcase, "With active_support"
  ps sd.mb_chars.upcase.to_s, su.mb_chars.downcase.to_s, "With active_support mb_chars"
  
  $ ruby -KU test.rb
  @ 1.8.7 UTF8
  Plain ruby                    :  IñTëRNâTIôNàLIZæTIøN / iÑtËrnÂtiÔnÀlizÆtiØn
  With active_support           :  IñTëRNâTIôNàLIZæTIøN / iÑtËrnÂtiÔnÀlizÆtiØn
  With active_support mb_chars  :  IÑTËRNÂTIÔNÀLIZÆTIØN / iñtërnâtiônàlizætiøn
  
  $ ruby1.9 test.rb
  @ 1.9.1 UTF-8
  Plain ruby                    :      IñTëRNâTIôNàLIZæTIøN / iÑtËrnÂtiÔnÀlizÆtiØn
  With active_support           :      IñTëRNâTIôNàLIZæTIøN / iÑtËrnÂtiÔnÀlizÆtiØn
  With active_support mb_chars  :      IñTëRNâTIôNàLIZæTIøN / iÑtËrnÂtiÔnÀlizÆtiØn
  </code></pre>
  
  <p>So, how do I get internationalized <code>upcase</code> and <code>downcase</code> with ruby 1.9.1?</p>
  
  <h3>update</h3>
  
  <p>I should add that I also tested with ActiveSupport from the current <code>master</code>, <code>2-3-*</code> and <code>3-0-unstable</code> rails branches at GitHub. Same results.</p>