MySQL drive does not recognize nor enforce UTF-8 encoding for
Ruby 1.9. There is a problem with MySQL text and varchar fields for
Rails3 and Ruby 1.9. They are not correctly encoded. Instead of
UTF-8 they come as ASCII-8BIT, binary data, and when it is mixed
with other UTF-8 text, Rails will raise an exception.
field = MyModel.first.field
field.encoding # => ASCII-8BIT
currently it has to dirty fix:
field = MyModel.first.field.force_encoding('UTF-8').encoding #
=> UTF-8
The patch enforce UTF-8 encoding for Active Record and
MySQL.