HeChian Hsu
2009-Aug-04 08:23 UTC
Mysql::Error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
Hi, I''ve got an error when I upload a record by iPhone with Chinese character. Processing ScoresController#create (for 123.204.56.133 at 2009-08-04 16:19:52) [POST] Parameters: {"score"=>{"score"=>"79.60", "player_name"=>"一", "iphone_identifier"=>"6b194f783d645ba1a7c30c0e31b1b67300eb0a25"}, "product_id"=>"7"} ^[[4;35;1mSQL (0.1ms)^[[0m ^[[0mSET collation_database = ''utf8_general_ci'' ^[[0m ^[[4;36;1mSQL (0.1ms)^[[0m ^[[0;1mSET collation_connection = ''utf8_general_ci'' ^[[0m 7--- !map:HashWithIndifferentAccess score: "79.60" player_name: !binary | 5LiA iphone_identifier: 6b194f783d645ba1a7c30c0e31b1b67300eb0a25 ^[[4;35;1mSQL (0.2ms)^[[0m ^[[0mSHOW VARIABLES LIKE ''collation_database''^[[0m Collation: utf8_general_ci ^[[4;36;1mScore Load (0.0ms)^[[0m ^[[0;1mMysql::Error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ''='': SELECT * FROM `scores` WHERE (`scores`.`product_id` = ''7'' AND `scores`.`iphone_identifier` = ''6b194f783d645ba1a7c30c0e31b1b67300eb0a25'' AND `scores`.`player_name` = ''一'') LIMIT 1^[[0m ActiveRecord::StatementInvalid (Mysql::Error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ''='': SELECT * FROM `scores` WHE RE (`scores`.`product_id` = ''7'' AND `scores`.`iphone_identifier` = ''6b194f783d645ba1a7c30c0e31b1b67300eb0a25'' AND `scores`.`player_name` = ''一'') LIMIT 1): app/controllers/scores_controller.rb:59:in `create'' Any ideas? Thank you. HeChian Hsu hechianhsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org