MySQL code is latin1, rails code utf8, how to solve the problem of Chinese garbled code

  mysql, question

MySQL code is latin1, rails code utf8, how to convert rails code utf8 into latin1 to solve the problem of Chinese garbled code

mysql
 Show variables like 'char percentage';
 Plus-plus-plus-plus
 | Variable_name | Value |
 Plus-plus-plus-plus
 | character_set_client | latin1 |
 | character_set_connection | latin1 |
 | character_set_database | latin1 |
 | character_set_filesystem | binary |
 | character_set_results | latin1 |
 | character_set_server | latin1 |
 | character_set_system | utf8 |
 | character_sets_dir | /usr/share/mysql/charsets/ |
 Plus-plus-plus-plus
 
 select * from auto_brands;
 Plus-plus-plus-plus-plus-plus-plus-plus
 | id | brand | created_at | updated_at |
 Plus-plus-plus-plus-plus-plus-plus-plus
 | 1 | Honda | 2011-06-02 05: 49: 43 | 2011-06-02 05: 49: 43 |
 | 2 | BMW | 2011-06-02 05: 56: 32 | 2011-06-02 05: 56: 32 |
 Plus-plus-plus-plus-plus-plus-plus-plus
 
 database.yml
 development:
 adapter: mysql2
 encoding: latin1
 database: meiying_china_development
 pool: 5
 username: root
 password: 123
 socket: /var/run/mysqld/mysqld.sock

It is suggested to unify the environment into UTF-8, which is simpler than latin1 <=> UTF-8 conversion.