Patch not the best solution, but it works, if you have always
A good overview of the problem from Yehuda Katz
Check carefully that 1) the encoding of data from the database; 2) the encoding of the form data, which are further stored in the database and 3) the encoding of the templates and views (view) — for example, save all in UTF-8 without BOM.
'mysql' often returns data in ASCII-8BIT (default encoding for binary data). As a variant put 'ruby-mysql'.
'pg' works for me without errors.