用最新版的mysql,没有中文问题。

解决方案 »

  1.   

    字符转换的问题,我也碰见过.如果你是用连接池的话,我只能建议你用5.x版的MySql了.
    如果不是用连接池,试试在连接MySql的时候这样连:jdbc:mysql://localhost:3306/test?autoReconnect=true;useUnicode=true;characterEncoding=GB2312
      

  2.   

    你是用java获得中文的么??如果是--我可能明白
      

  3.   

    jsp页面:
          <form >
            <input type="text" name="aa">
          </form>
    java程序:
          String aa = request.new String(getParameter("aa").getBytes("iso8859-1"));
          把这样得到的数值插入到数据库就可以了
      

  4.   

    使用以下两个函数就行了
    public static String cvtISO2GBK(String str){
            
            try {
                byte[] byteStr = str.getBytes("ISO-8859-1");
                return new String(byteStr, "GBK");
            }
            catch(Exception e) {
                return str;
            }
        }
    public static String cvtGBK2ISO(String str){
            
            try {
                byte[] byteStr = str.getBytes("GBK");
                return new String(byteStr, "ISO-8859-1");
            }
            catch(Exception e) {
                return str;
            }
        }
      

  5.   

    try{ result = new String(result.getBytes("ISO8859_1"),"GB2312");
    }catch(Exception e)
    {
    e.printStackTrace();
    }
      

  6.   

    我是上传文件时用的
     name=fileItem.getFieldName();
     value=fileItem.getName();
    这样在本地页面显示正常,但是插到数据库就成了乱码!
      

  7.   

    在mysql中设置默认编码使用gbk就ok了
      

  8.   

    修改my.ini文件如下WinMySQLAdmin]
       Server=D:/mysql/bin/mysqld-nt.exe
       
    [mysqld]
       basedir=D:/mysql
       datadir=D:/mysql-data/data   default-character-set=gbk  //这里
       
    [client]
       default-character-set=gbk  //这里