Encoding in Rails

By default, Ruby has no encoding or character set support in its String class...
...Some of this behaviour can be fixed with the jcode library...

$KCODE = 'UTF8'
require 'jcode'

...Another solution is the Unicode library by Yoshida Masato. This library contains some functions (like Unicode::upcase etc.) to handle UTF-8 encoded strings...
...Here's some info on how Ruby 2.0 strings will be...

Specially for Rails:
...Julian Tarkhanov's Unicode hack plugin for Rails to fix the String class by overriding the existing one with Unicode aware methods where necessary. The plugin also puts your database server in UTF-8 mode and updates the Content-Type header sent by Rails.