java/bin/  下面有这个工具native2ascii.exe

解决方案 »

  1.   

    FileInputStream fis = new FileInputStream("youfilename");
    InputStreamReader isr = new InputStreamReader(fis, "UTF8");
    Reader in = new BufferedReader(isr);
      

  2.   

    TO:weiminghui(水雾) 我按你的方法,但有的字符能正常显示,有的还是显示"?"
      

  3.   

    public void readUTF8() throws IOException, UnsupportedEncodingException
        {
            FileInputStream fis = new FileInputStre(GlobalConstants.$SYS_ROOT+"\\appl.properties");
            //BufferedInputStream isr = new BufferedInputStream(fis);
            //Reader in = new BufferedReader(isr);
           InputStreamReader isr =new InputStreamReader(fis,"utf-8");
            //byte[] a = new byte[isr.read()];
            System.out.println("readUTF8--getEncoding()---"+isr.getEncoding());
            char[] ab=new char[isr.read()*10];
            int i=isr.read(ab);
            //for (int i=0;i<isr.read();i++)
            {
                //isr.
                System.out.println("readUTF8================"+i+new String(ab));
            }
        }
      

  4.   

    你的意思,文件是用UTF8 编码的,想用gb2312 显示为正常汉字??
      

  5.   

    如果文件是UTF-8,读出来还是UTF-8编码格式的
      

  6.   

    那有没有办法把读出来的UTF-8转换成gb2312呢!?
      

  7.   

    DataaINputStream in=new DataInputStream(new FileInputStream("xxx"));
    String str=in.readUTF();
      

  8.   

    native2ascii -gb2312 ApplicationResources_temp.properties ApplicationResources.properties转为gb2312的