I cannot insert Chinese in the table. I have already config the charset and collation as utf8 and utf8_general_ci. The database and table is created as utf8.
Also, I have tried charset as utf8mb4 and collation as utf8_unicode_ci, utf8mb4_general_ci, utf8mb4_unicode_ci. All of them point to same error : warning 1366 Incorrect String value.
Big5 and GBK encoding work in this case but I would like to use utf8, as simplified, traditional chinese will be allow to insert.
some of the code in mysql:
create database db1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
create table table1 (
lastName varchar(255),
firstName varchar(255)
) ENGINE = MYISAM CHARSET=utf8 COLLATE utf8_general_ci;
INSERT INTO table1 VALUES ('陳','小文');
Warning | 1366 | Incorrect string value: '\xB3\xAF' for column 'lastName' at r
w 1 |
Warning | 1366 | Incorrect string value: '\xA4p\xA4\xE5' for column 'firstName
at row 1 |
configuration in my.ini:
[client]
default-character-set=utf8
[mysqld]
default-storage-engine=MyISAM
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server=utf8
skip-character-set-client-handshake=1
[mysql]
default-character-set=utf8
Using Mysql 5.6.8 version.
Big5) you have to declare you're using that other encoding so MySQL libraries have the chance of converting data back and forth. Just saying "use UTF-8" is not a magic fix for all encoding issues ever. I'm sure your server-side settings are fine. - Álvaro González