Search code examples
mysqldatabasedatabase-designutf-8utf-16

Encoding database utf-8 or utf-16


I am importing a database from outside which have unicode characters as 我的上网主页 and 嶏紞鎴戠殑 in Chinese , Japaneses and other different languages.

I have executed a query to make my database encoding to utf-8 from

ALTER DATABASE DEFAULT CHARSET 'utf8';

But when i import data to my database tables i get ????? instead of above characters. How can i encode these characters? Is it utf-8 or 16 and how i can recognize that which encoding will support these characters?

Any Idea will be highly appreciated.


Solution

  • MySQL uses UTF-8. Make sure you had configured the connection character set properly, the way of the configuration depends on the connectivity library you are using.