隨筆-5  評論-0  文章-0  trackbacks-0
          • 編輯mysql的配置文件my.ini,設(shè)置字符集為gbk
          [client]

          port
          =3306

          [mysql]

             default-character-set=gbk
          # SERVER SECTION
          ----------------------------------------------------------------------
          #
          # The following options will be read by the MySQL Server. Make sure that
          # you have installed the server correctly (see above) so it reads 
          this 
          # file.
          #
          [mysqld]

          # The TCP
          /IP Port the MySQL Server will listen on
          port
          =3306


          #Path to installation directory. All paths are usually resolved relative to 
          this.
          basedir
          ="D:/Program Files/MySQL/MySQL Server 5.1/"

          #Path to the database root
          datadir
          ="D:/Program Files/MySQL/MySQL Server 5.1/Application Data/Data/"

          # The 
          default character set that will be used when a new schema or table is
          # created and no character set is defined
          default-character-set=gbk

          # The 
          default storage engine that will be used when create new tables when
          default-storage-engine=INNODB
          • 使用MySQL Workbench設(shè)計數(shù)據(jù)庫 ,數(shù)據(jù)庫和表均使用默認(rèn)的字符集
          • 在Servlet中轉(zhuǎn)換字符編碼
          String name = request.getParameter("name");
          name 
          = new String(name.getBytes("ISO-8859-1"));
          • 設(shè)置JSP頁面字符集為GBK
          <%@ page language="java" pageEncoding="GBK"%>
          posted on 2010-02-10 00:52 心情 閱讀(387) 評論(0)  編輯  收藏 所屬分類: mysql

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 定结县| 合肥市| 长白| 嫩江县| 九龙城区| 古交市| 西充县| 双鸭山市| 乌恰县| 嫩江县| 渝中区| 四子王旗| 乐昌市| 贵定县| 黄大仙区| 郁南县| 石渠县| 江达县| 横山县| 浪卡子县| 山丹县| 岑巩县| 叶城县| 汨罗市| 炎陵县| 沁源县| 宝坻区| 巩留县| 通山县| 盖州市| 庆城县| 巴中市| 盘锦市| 思茅市| 法库县| 康定县| 铜川市| 高雄市| 开鲁县| 东平县| 彭州市|