Reputation: 33
I am reading (mysql) data to display on the view using ruby on rails. Everything is displayed fine, only the text is not in unicode, there are some text that are written in my native language and they can't be displayed correctly, all those letters are re-marked as question marks.
Upvotes: 1
Views: 531
Reputation: 844
Ruby default charset is UTF-8. So:
And, by the way, if you read something from text files, utf-8 is not default charset(I still don't understand why). If you store in text files something but code, add
# encoding: UTF-8
at the start of the file.
Upvotes: 0
Reputation: 5107
You have to change default MySQL charset and collation through the MySQL console. Here's the simple guide how to do that: http://www.devcha.com/2008/03/convert-existing-mysql-database-from.html
Upvotes: 1