On SQLITE this way fine. I switch to mysql and instead of クイン
i get ???
. The column is TEXT or sometimes VARCHAR(255) (i believe its VARCHAR(255) in this case).
How do i have mysql save the characters properly?
On SQLITE this way fine. I switch to mysql and instead of クイン
i get ???
. The column is TEXT or sometimes VARCHAR(255) (i believe its VARCHAR(255) in this case).
How do i have mysql save the characters properly?
Table/column character sets need to be set to a version that supports multibyte like UTF8.
You may be able to tell the current table character set by doing a
mysql> SHOW CREATE TABLE tbl_Name;
It may not show you anything in which case it's using the default defined in you my.cnf
To change a character set on a table run:
mysql> ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
I don't recommend this if you have a lot of data or can't remove the data and start fresh. The transition needs to remove the bad data first.
I read through this post and it seems in depth and from what I can remember of my own battles with this very accurate. http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html
Also, to create new tables as UTF-8 append *CHARACTER SET utf8 COLLATE utf8_general_ci* to the end of your CREATE TABLE statements
Verify that you have specified "charset=utf8" in your connection string. For example
connectionString="Server=myServerHost;charset=UTF8;Database=myDatabase;Uid=root;Pwd=password;"
As noted in Character Sets and Collations in General MySQL can do: