struts国际化:浏览器表单提交中文,链接提交日文,全是乱码。怎么办啊?

解决方案 »

  1.   

    <%@ page contentType="text/HTML; charset=Shift_JIS" %>
    你是说这个么?
      

  2.   

    <%@ page contentType="text/HTML; charset=Shift_JIS" %>这个应该没问题吧
    不行你就在struts中作个字符转化 public String toJapanese(String ss)
        {
           if (ss != null) {
            try {
               String temp_p = ss;
               byte[] temp_t = temp_p.getBytes("ISO8859-1");
               ss = new String(temp_t);
            }
            catch (Exception e) {
               System.err.println("toJapanese exception:" + e.getMessage());
               System.err.println("The String is:" + ss);
            }
          }
          return ss;
        }
        public String toJapaneseUTF(String ss)
        {
           if (ss != null) {
            try {
               String temp_p = ss;
               byte[] temp_t = temp_p.getBytes("ISO8859-1");
               ss = new String(temp_t,"utf-8");
            }
            catch (Exception e) {
               System.err.println("toJapanese exception:" + e.getMessage());
               System.err.println("The String is:" + ss);
            }
          }
          return ss;
        }
    这两个 忘了是那个了  你试试吧!应该有个能用。
      

  3.   

    byte[] temp_t = temp_p.getBytes("ISO8859-1");
    ss = new String(temp_t,"utf-8");
    中的 ISO8859-1和utf-8是可以用其他替换的,上面的不行你就换其他的编码形式试一下。
    不知道有没有更好的解决方法,高手请指点。
      

  4.   

    http://blog.csdn.net/feng_sundy/archive/2004/10/17/139647.aspx