为什么我的网页上的中文全变成了��ѯ��??郁闷
怎么把它改成中文啊

解决方案 »

  1.   

    <HTML>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title></head>
    <BODY>
    <%@ page contentType="text/html;charset=utf-8" %>
    <%@ page import="java.sql.*" %>
    <%!
    public String codeToString(String str)
    {//处理中文字符串的函数
      String s=str;
      try
       {
       byte tempB[]=s.getBytes("ISO-8859-1");
      s=new String(tempB);
       return s;
      }
     catch(Exception e)
       {
        return s;
       }  
    }
    %><%//构造查询SQL语句
       int countRecord=0;//记录条数
       int countPageRecord=10;//每页记录条数
       int countPage=0;//总页数
       int dipage=1;// 当前页码数默认为1
       String pages=request.getParameter("dipage");
     if(pages==null)
    {
      pages="1";
    }
     try
    {
      dipage=Integer.parseInt(pages);
    }
     catch(Exception e)
    {
      dipage=1;
    }   String kk;
     //  String isselect="seleted";
     kk=codeToString(request.getParameter("updata"));
     if(kk==null||"".equals(kk))
     kk=codeToString(request.getParameter("ctoj_or_jtoc"));
     if(kk==null)
     {
      kk="ctoj";
    }
     //else{
      // kk=codeToString(request.getParameter("ctoj_or_jtoc"));
    //}  
       //[document.myform.ctoj_or_jtoc.selectedIndex].text;
      String sqlString=null;//SQL语句
      //request.form("select");
      // String ctoj_or_jtoc= request.getParameter("ctoj_or_jtoc");
      String You_want=codeToString(request.getParameter("You_want"));
       
      if("ctoj".equals(kk)){
      
      if(You_want==null||You_want.trim().length()==0)
        sqlString=new String("SELECT * FROM cnjp");
      else
        sqlString=new String("SELECT * FROM cnjp where CNword = '"+You_want.trim()+"'");
     }
    if("jtoc".equals(kk))
    //else
    {
    if(You_want==null||You_want.trim().length()==0)
        sqlString=new String("SELECT * FROM jpcn");
      else
         sqlString=new String("SELECT * FROM jpcn where JPword = '"+You_want.trim()+"'");
        //sqlString=new String("SELECT * FROM 1 where jtc like '%"+You_want.trim()+"%'");
    }
    out.print(sqlString);
    out.print(kk);  
      
    %>
      

  2.   

    是UTF-8格式的,因为有日文显示,所以不能该成BG2312
      

  3.   

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    改为
    <meta http-equiv="Content-Type" content="text/html; charset=shift_jis" />
      

  4.   

    out.print("<Table Border>");
             out.print("<form action=search.jsp method=post name=myform>");
             out.print("<TR><td>查询单词</td>");
             out.print("<td colspan=7>");
             out.print("<input type=text name=You_want>");
             out.print("查询方式<select name=ctoj_or_jtoc>");
    是不时用了out.print("查询方式<select name=ctoj_or_jtoc>");<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />就不管用了啊?
      

  5.   

    这句话放在最上面上面<head>标签里打印
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      

  6.   

    也没有啥用.是不是因为我的HTML都是以out.print()输出有关呢,感觉<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />根本就不起作用.完全听<%@ page contentType="text/html;charset=utf-8" %>的