JAVA程序不能输出汉字,请指教
程序如下:
import java.io.*;
public class charactor  {  public static void main(String[] args)
   {
     try{BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    String s=br.readLine();
    String result = new String(s.getBytes("IS08859_1"), "GBK");
    System.out.println("the output is:"+s);}catch(IOException e){System.out.println(e);}
   }
}

解决方案 »

  1.   

    import java.io.*;
    public class charactor  {  public static void main(String[] args)
       {
         try{BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        //String result = new String(s.getBytes("IS08859_1"), "GBK");
        System.out.println("the output is:"+s);}catch(IOException e){System.out.println(e);}
       }
    }
      

  2.   

    并不是所以有汉字处理都是:
    String result = new String(s.getBytes("IS08859_1"), "GBK");IS08859_1是编码,GBK是对应的解码。根据你的s搞清楚了应该就可以了。