rake db:seed for i18n data
I am running rake db:seed to populate i18n data in the database but it doesn't recognize the i18n characters. The error that I get is --
rake aborted!
$HOME/db/seeds.rb:9: invalid multibyte char (US-ASCII)
$HOME/db/seeds.rb:9: invalid multibyte char (US-ASCII)
$HOME/db/seeds.rb:9: syntax error, unexpected $end, expecting '}'
Do I need to convert the native lang开发者_Python百科uage strings into UTF-8 characters before calling the rake?
Just add the following line as the first line of your seeds.rb the file:
# -*- coding: utf-8 -*-
UPDATE:
In ruby 2.0 (and seems above) you don't need to do this anymore, utf-8
is now being the default encoding.
精彩评论