The cookie is encoded using the big5 set, and it cannot insert into MySQL. Could you help me to solve this problem?
Fields: username is eng, date1
Use UTF-8 when you create table.
create table table_name () CHARACTER SET = utf8;
Use UTF-8 when you insert to table
set username utf8; INSERT INTO table_name (ABC,VAL);
Read More
And More
Detailed Code
Below code is tested code please do the following its works.
If you have already created database please ALTER it as below code. And if you didn't created database then create it and set Collation to utf8_unicode_ci
And same for table define Collation as "utf8_unicode_ci" for table fields in which you want to store chines chars.
ALTER DATABASE `stackoverflow` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE TABLE `stackoverflow`.`chines`
(
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`words` VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE = InnoDB;
';
}
?>
See the result and step visual as below.
