E
E
Ener2011-01-09 16:01:28
ruby
Ener, 2011-01-09 16:01:28

incompatible character encodings: ASCII-8BIT and UTF-8

Encoding problem in ruby ​​1.9.2

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zizop, 2011-01-09
@zizop

Try this minipatch:
rails.lighthouseapp.com/projects/8994/tickets/2476-ascii-8bit-encoding-of-query-results-in-rails-232-and-ruby-191#ticket-2476-22

D
danchenkov, 2012-01-14
@danchenkov

The patch is not the best solution, but it works if you always have UTF-8.
Good overview of the problem by Yehuda Katz
Carefully check 1) data encoding from the database; 2) the encoding of the form data, which is later saved to the database, and 3) the encoding of templates and views (view) - for example, save everything in UTF-8 without BOM.
'mysql' often returns data in ASCII-8BIT (the standard encoding for binary data). Alternatively put 'ruby-mysql'.
'pg' works for me without errors.

V
Vitaly Simakov, 2014-04-04
@vsting

The 'russian' gem helped me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question