I had a similar error. You have to change tables and columns to <span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">UTF-8. There should be a script but you can do it manually. Yes Rails should look after to those details, I guess it could be a bug (it happened to me with Rails 2.3.12). You could put the SQL command to fix the issue in a migration...</span><br>
<br><div class="gmail_quote">On 23 January 2012 17:56, Andrew Stewart <span dir="ltr"><<a href="mailto:boss@airbladesoftware.com">boss@airbladesoftware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hola El Rug,<br>
<br>
I have a Rails app which started life as Rails 2.x and is now Rails 3.0.y.  It sits on top of a MySQL database.<br>
<br>
I have just started to see collation errors both at the Rails level and in the mysql console.  For example:<br>
<br>
    mysql> select * from samples where code = 'abcd‐01‐s10‐036';<br>
    ERROR 1267 (HY000): Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='<br>
<br>
    mysql> show create table samples;<br>
    [snip] ENGINE=InnoDB AUTO_INCREMENT=54307 DEFAULT CHARSET=latin1<br>
<br>
In the Rails console:<br>
<br>
    >> ActiveRecord::Base.connection.collation<br>
    "latin1_swedish_ci"<br>
<br>
Now I thought Rails ensured everything from top to toe was UTF-8; apparently not in this case.  Anyway, how do I best fix this (while staying with MySQL)?<br>
<br>
Thanks in advance.<br>
<br>
Yours,<br>
Andy Stewart<br>
<br>
-------<br>
<a href="http://airbladesoftware.com" target="_blank">http://airbladesoftware.com</a><br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Riccardo Tacconi<br>Ruby on Rails and PHP development - System Administration<br>VIRTUELOGIC LIMITED<br><br><a href="http://github.com/rtacconi" target="_blank">http://github.com/rtacconi</a><br>
<a href="http://riccardotacconi.blogspot.com" target="_blank">http://riccardotacconi.blogspot.com</a><br><a href="http://twitter.com/rtacconi" target="_blank">http://twitter.com/rtacconi</a><br>