当然可以啊,但是你要自动用函数转换。并且不能用charset标签了

解决方案 »

  1.   

    to  wjmmml(笑着悲伤) 
         具体如何实现,能否举个例子之类的,谢谢!!
      

  2.   

    在你用日文的地方,把unicode字符转换成日文字符,在中文的地方,转换成中文。就可以了。给两个方法
    public static String UnicodeToChinese(String s){
      try{
         if(s==null||s.equals("")) return "";
         String newstring=null;
         newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
         return newstring;
        }
      catch(UnsupportedEncodingException e)
      {
      return s;
      }
      }public static String UnicodeToJa(String s){
      try{
         if(s==null||s.equals("")) return "";
         String newstring=null;
         newstring=new String(s.getBytes("ISO8859_1"),"Shift_JIS");
         return newstring;
        }
      catch(UnsupportedEncodingException e)
      {
      return s;
      }
      }public static String ChineseToUnicode(String s){
      try{
      if(s==null||s.equals("")) return "";
      String newstring=null;
      newstring=new String(s.getBytes("gb2312"),"ISO8859_1");
       return newstring;
      }
      catch(UnsupportedEncodingException e)
      {
      return s;
     }
      }
      

  3.   

    第2个方法是把unicode——》日文的。
      

  4.   

    to wjmmml(笑着悲伤) 
    我是从数据库中取的数据,可能是中文,可能是日文,我如何判断取出的是日文还是中文。
      

  5.   

    如果你的数据是基于unicode在数据里存放的就很简单,直接读出来,不用作任何转码的工作,然后用下面的方法输出到页面就可以了。
    =================================================
    public static String java2HTML(String content)
    {
    StringBuffer codeTemp = new StringBuffer();
    if (content == null)
    {
    content = "";
    } for (int i = 0; i < content.length(); i++)
    {
    codeTemp.append("&#x").append(Integer.toHexString((int) content.charAt(i))).append(";");
    } return codeTemp.toString();
    }