中文在某种编码(如ISO8859_1)编译下显示的乱码~~~是用jb打开的吗~用ue看看~应该是中文

解决方案 »

  1.   

    \u2014好像记得是一种十六进制的表式方式。有点忘了。不知这样对不对:\u2014=2*16*16*16+1*16+4=4116   不会对应这个ACSII码的值吧。<\u2014\u2014不知这表达什么意思!
     
      

  2.   

    我是在ultraedit编辑器下打开的。
      

  3.   

    unicode
    显示unicode可以把字符串构造成GBK
        String str = "\u2014\u2014";
        str = new String(str.getBytes(),"GBK");
        System.out.println(str);
    结果是:——
      

  4.   

    楼上的对~其实就是中文或符号~我想起来了~~我做邮件的时候用过他显示中文标题~比如
    \u62C6 拆 chāi
    \u62C7 拇 mǔ
    \u62C9 拉 lā
    原来是
    —赫赫~~
      

  5.   

    我按楼上的意思写一个程序测试一下。
    import java.io.*;public class MyJava
    {
      public static void main(String args[])
      { 
        String str = "\u2014\u2014";
        str = new String(str.getBytes(),"GBK");  //出错;
        System.out.println(str);  }
    }不知为何程序编译不能通过。
      出现如下错误:
      MyJava.java:8: unreported exception java.io.UnsupportedEncodingException; must b
    e caught or declared to be thrown
        str = new String(str.getBytes(),"GBK");  初学java..望给予指点!
      

  6.   

    想得到这样的效果:
    unicode
    显示unicode可以把字符串构造成GBK
        String str = "\u2014\u2014";
        str = new String(str.getBytes(),"GBK");
        System.out.println(str);
    结果是:——
    我按楼上的意思写一个程序测试一下。
    import java.io.*;public class MyJava
    {
      public static void main(String args[])
      { 
        String str = "\u2014\u2014";
        str = new String(str.getBytes(),"GBK");  //出错;
        System.out.println(str);  }
    }不知为何程序编译不能通过。
      出现如下错误:
      MyJava.java:8: unreported exception java.io.UnsupportedEncodingException; must b
    e caught or declared to be thrown
        str = new String(str.getBytes(),"GBK");  初学java..谁能给我指正一下呀。
      

  7.   

    顶一下!刚学java编程。问题太菜。望各位多多指点!
      

  8.   

    <%String str = "\u2014\u2014";
        str = new String(str.getBytes(),"GBK");
        System.out.println(str);%>是让写到jsp叶面里试试吧
      

  9.   

    晕。我没有装jsp服务器。因为我想在asp中用到一个java aplet的程序。因为程序有上面这代码我才问这问题。不过我jsdk是安装过了。现在在用asp,不过jsp服务器搭建很复杂。
      不知在jsdk下如何写个测试程序!
      

  10.   

    晕了,try一下这样吧:public class MyJava
    {
      public static void main(String args[])
      { 
       try{
        String str = "\u2014\u2014";
        str = new String(str.getBytes(),"GBK");  
        System.out.println(str);
       }catch(Exception e){
       }  }
    }