mysql database encoding issue...
时间:2010-08-10 来源:icymirror
Following issue happened while try to perform action on MySQL:
1. Database encoding
2. Insert record into database with encoding related data
for Issue 1:
solution a: (Short term solution)
create database [dbname] default character set utf8 collate utf8_general_ci;
or
create database DemoDB default character set gbk COLLATE gbk_chinese_ci
solution b: (Persistent solution)
update mysql configuration, change default encoding setting
for issue 2:
solution a: (Short term solution)
insert into [tablename] (fielda, fieldb)
values (valuea character set gbk [or use utf8],
valueb character set gbk [or use utf8]
)
solution b: (persistent solution)
Same as DB related solution, update the default character set in configuration file