Rails 3 - (incompatible character encodings: UTF-8 and ASCII-8BIT)?

I remember resolving this once by using "string". Force_encoding("UTF-8").

I've gotten this error when there is an encoding mismatch between how my Ruby app is parsing strings and how the database stores them. To fix this for myself when I'm dealing with UTF-8, I make sure I have this at the top of the . Rb file in question: # encoding: utf-8 Alternatively, you can globally set default UTF-8 encoding in your application config file with this line: Encoding.

Default_internal, Encoding. Default_external = 'utf-8' * 2 And finally, I make sure that my database is using UTF-8 internally by setting the encoding option in database. Yml: development: adapter: postgresql encoding: UTF8 database: pg_development username: abe pool: 5.

In the end my problem was caused by static I18n files which held binary data placed there by some plugin web interface I used for managing translation. Look for things like day:! Binary | RMOtYQ== in your i18n files.

– mark Jun 22 at 18:35.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions