MySQLの漢字表示

戻る

CGIプログラムに追加 $self->dbh->do("SET NAMES utf8"); mysql> select * from hull_no where id > 364; +-----+------------------------------------+--------------------+-------+------+------+ | id | HULL_NO | name | built | flag | memo | +-----+------------------------------------+--------------------+-------+------+------+ | 365 | 譁ー鬮倡衍驥榊キ・ DOCKYARD SNO. | M.V: SAN YANG | NULL | NULL | NULL | | 366 | 逾樒伐縲€ 31 | M.V. APEX GRANDRUR | NULL | NULL | NULL | +-----+------------------------------------+--------------------+-------+------+------+ 2 rows in set (0.00 sec) mysql> set NAMES sjis; Query OK, 0 rows affected (0.01 sec) mysql> select * from hull_no where id > 364; +-----+-------------------------------+--------------------+-------+------+------+ | id | HULL_NO | name | built | flag | memo | +-----+-------------------------------+--------------------+-------+------+------+ | 365 | 新重工 DOCKYARD SNO.   | M.V: SAN YANG | NULL | NULL | NULL | | 366 | 神田  31 | M.V. APEX GRANDRUR | NULL | NULL | NULL | +-----+-------------------------------+--------------------+-------+------+------+ 2 rows in set (0.00 sec)

戻る