JSP中文

| 1 Comment | No TrackBacks

<%
String Hello="欢迎光临!";
Byte []b=Hello.getBytes("ISO-8859-1");
Hello=new String(b);
out.print(Hello);
%>

No TrackBacks

TrackBack URL: http://www.wujianrong.com/mt-tb.cgi/1336

1 Comment

文件名存放在MySQL中,MySQL默认不支持中文

修改两处就可以让MySQL支持UTF8
在建表的"create table"语句最后加上"CHARACTER SET utf8"
在JDBC连接数据库的URL后加上参数"?useUnicode=true&characterEncoding=utf8"
这样中文数据就可以以UTF8的形式存放了。

Leave a comment

About this Entry

This page contains a single entry by kevinwu published on November 6, 2006 2:53 PM.

JVM调优[转] was the previous entry in this blog.

web一些值得珍藏的代码 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.