Merry
Christmas
2012!
If you know where it's going
it's not worth doing !
Company Digest : Hap Seng Consolidated Berhad 1 day ago
Northern Lights in Iceland 20 Feb 2013
U Mobile 42mbps Broadband Review 08 Jan 2012
29
MAY
2010
Just added a new trade section, dedicated to the sharing of my trading experience and stock selection.
I've decided to write in chinese, so have spent some time to enable chinese character support. Actually it's just 3 simple steps.
Read on for instructions on displaying chinese character for a site powered by Java, Tomcat and Mysql.
In Context.xml, edit Data Source
<...mysql://localhost:3306/db_test?useUnicode=true&characterEncoding=utf-8"/>If you want chinese charater in URL, like http://www.derekdan.com/trade?tag=手套股, edit the following in Server.xml
<Connector port="80" ... URIEncoding="UTF-8"/> <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> Excecute ALTER TABLE for every column that contains chinese character
ALTER TABLE <TABLE_NAME> MODIFY COLUMN <COLUMN_NAME> VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_ciBeware that NOT all data type support character set, e.g. BLOB stores data in byte format, so you can't assign any CHARACTER SET to it.
For this reason, previous I was using BLOB type to store my article content, now have to change to TEXT.
0
CMMT
add a comment