Patch not the best solution, but it works, if you have
always UTF-8.
\r
A good overview of the problem from
Yehuda Katz\r
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.
\r
'mysql' often returns data in ASCII-8BIT (default encoding for binary data). As a variant put 'ruby-mysql'.
\r
'pg' works for me without errors.