最近はUTF-8のみで、すっかり忘れていたのでメモ

http://dev.mysql.com/doc/refman/5.6/en/charset-unicode-sets.html



root@localhost [(none)]>charset utf8;
Charset changed

root@localhost [(none)]>SHOW VARIABLES LIKE '%_connection';
+--------------------------+-----------------+
| Variable_name            | Value           |
+--------------------------+-----------------+
| character_set_connection | utf8            |
| collation_connection     | utf8_general_ci |
+--------------------------+-----------------+
2 rows in set (0.01 sec)

root@localhost [(none)]>SELECT (CASE WHEN 'e'='è' THEN "同じ" ELSE "異なる" END);
+---------------------------------------------------------+
| (CASE WHEN 'e'='è' THEN "同じ" ELSE "異なる" END)       |
+---------------------------------------------------------+
| 同じ                                                    |
+---------------------------------------------------------+
1 row in set (0.00 sec)

root@localhost [(none)]>charset latin1;
Charset changed

root@localhost [(none)]>SHOW VARIABLES LIKE '%_connection';
+--------------------------+-------------------+
| Variable_name            | Value             |
+--------------------------+-------------------+
| character_set_connection | latin1            |
| collation_connection     | latin1_swedish_ci |
+--------------------------+-------------------+
2 rows in set (0.00 sec)

root@localhost [(none)]>SELECT (CASE WHEN 'e'='è' THEN "同じ" ELSE "異なる" END);
+---------------------------------------------------------+
| (CASE WHEN 'e'='è' THEN "同じ" ELSE "異なる" END) |
+---------------------------------------------------------+
| 異なる                                               |
+---------------------------------------------------------+
1 row in set (0.00 sec)

root@localhost [(none)]>

Comments are closed.

Post Navigation