Friday, August 24, 2012

How to check if MySql table supports utf8 format


The best way to find if a MySql table is in UTF-8 format is to query the information schema. 

Use below query: 


select c.character_set_name from information_schema.tables as t,
     information_schema.collation_character_set_applicability as cwhere c.collation_name = t.table_collationand t.table_schema = "your_db"
and t.table_name = "table_name";


This would work with just mysql version >= 5.0.

Enjoy. 

No comments:

Post a Comment