Hi guys,

I am using mysql. Recently I changed the character set from Latin1 to
UTF-8.
I met an issue when I inserted a new record. It showed up some illegal
characters. Per my test, I thought it converted the value from UTF-8 to
Latin1 and then saved in table.


If I add “:encoding => "utf8"” to establiash_connection method, the
problem will be solved. Is there any default value for :encoding in
establish_connection?


  ActiveRecord::Base.establish_connection(
    :adapter  => "mysql",
    :host     => "localhost",
    :username => "edwin",
    :password => "123456",
    :database => "products"
  )


Thanks in advance

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to