试试
<%@ page contentType="text/html; charset=gb2312" %> 
<% request.setCharacterEncoding("GB2312"); %> <%!
      public String getStr(String str)
         {
   try
      {
  String temp_p=str;
  byte[] temp_t=temp_p.getBytes("ISO8859-1");
  String temp=new String(temp_t,"GB2312");
  return temp;
      }
   catch(Exception e)
     {
      e.printStackTrace();
      }
  return "null";
        }
    %>
 <%!String tt;%>
 <%
 tt=request.getParameter("MC");
 //中文转换
 //tt=getStr(tt);
 tt=java.net.URLDecoder.decode(tt,"8859_1");
 out.println(tt);
 
 %>

解决方案 »

  1.   

    public  class TranslateString
    {
    public static String translateORACLEToJSP(String str)
    {
    String tempStr="";
    try
    {
    tempStr=new String(str.getBytes("gb2312"),"ISO-8859-1");

    }
    catch(Exception e)
    {
    System.err.println(e.getMessage());
    }
    return tempStr;
    }


    public static String translateJSPToORACLE(String str)
    {
    String tempStr="";
    try
    {
    tempStr=new String(str.getBytes("ISO-8859-1"),"gb2312");

    }
    catch(Exception e)
    {
    System.err.println(e.getMessage());
    }
    return tempStr;
    }

    }
      

  2.   

    <%@ page contentType="text/html; charset=gb2312" %> 
    <% request.setCharacterEncoding("GB2312"); %> <%!
          public static String translateJSPToORACLE(String str)
    {
    String tempStr="";
    try
    {
    tempStr=new String(str.getBytes("ISO-8859-1"),"gb2312");

    }
    catch(Exception e)
    {
    System.err.println(e.getMessage());
    }
    return tempStr;
    }
        %>
     <%!String tt;%>
     <%
     tt=request.getParameter("MC");
     //中文转换
     tt=getStr(tt);
     out.println(tt);
     
     %>
      

  3.   

    在我的机子上这段代码能够正确执行,你看看在你那里可以吗?
    <%@ page contentType="text/html; charset=gb2312" %> 
    <% request.setCharacterEncoding("GB2312"); %> <%!
          public static String getStr(String str)
    {
    String tempStr="";
    try
    {
    tempStr=new String(str.getBytes("ISO-8859-1"),"gb2312");

    }
    catch(Exception e)
    {
    System.err.println(e.getMessage());
    }
    return tempStr;
    }
        %>
     <%!String tt;%>
     <%
     if(!"".equals(tt)){
     tt=request.getParameter("user");
     //中文转换
     tt=getStr(tt);
     out.println(tt);
    }
     %>
      

  4.   

    我自己用是正确的
    public static String strToGB2312(String str){
    String newStr = null;
    try {
    newStr = new String(str.getBytes("ISO8859_1"), "GB2312");
    }catch (Exception e) {
    }
    return newStr;
    }
      

  5.   

    <%@ page contentType="text/html; charset=gb2312" %> 
                <% request.setCharacterEncoding("GB2312"); %>             <%!
                    public String getStr(String str)
                          {
                     String tempStr="";
             try
                {
          tempStr=java.net.URLDecoder.decode(str,"8859_1");;
         }
              catch(Exception e)
                {
           System.err.println(e.getMessage());
                 }
              return tempStr;
                          }
                   %>
               <%!String tt;%>
               <%
               tt=request.getParameter("MC");
               //中文转换
               tt=getStr(tt);
               out.println(tt);
     
               %>
      

  6.   

    <%@ page contentType="text/html; charset=gb2312" %> 
                <% request.setCharacterEncoding("GB2312"); %>             <%!
                    public String getStr(String str)
                          {
                     String tempStr="";
             try
                {
          tempStr=java.net.URLDecoder.decode(str,"8859_1");;
         }
              catch(Exception e)
                {
           System.err.println(e.getMessage());
                 }
              return tempStr;
                          }
                   %>
               <%!String tt;%>
               <%
               tt=request.getParameter("MC");
               //中文转换
               tt=getStr(tt);
               out.println(tt);
     
               %>
      

  7.   

    <%@ page contentType="text/html; charset=gb2312" %> 
    <% request.setCharacterEncoding("GB2312"); %> 
     <%
               tt=request.getParameter("MC");
               //中文转换
               //tt=getStr(tt);已经不需要再转码了,你的request不是已经设完了吗?
               out.println(tt);
               %>
      

  8.   

    <%@ page contentType="text/html; charset=gb2312" %> 
                <% request.setCharacterEncoding("GB2312"); %>             <%!
                    public String getStr(String str)
                          {
                     String tempStr="";
             try
                {
          tempStr=java.net.URLDecoder.decode(str,"8859_1");;
         }
              catch(Exception e)
                {
           System.err.println(e.getMessage());
                 }
              return tempStr;
                          }
                   %>
               <%!String tt;%>
               <%
               tt=request.getParameter("MC");
               //中文转换
               tt=getStr(tt);
               out.println(tt);
     
               %>