输入?的问题是由于unicode的问题。
你在输入以前用gb2312转一下。

解决方案 »

  1.   

    import java.io.*;
    public class win2
    {
       private static BufferedReader in = null;
       private static BufferedWriter out = null;
       static char ch,ch1 ,ch2;
       static char hz;
       static String str;
       public static void main(String[] args)
       {try
       {
           in = new BufferedReader(new FileReader("data.txt"));
           out = new BufferedWriter (new FileWriter("a.txt",true));
           for(;;)
           {
              int t = in.read();
              ch = (char)(t);
              if (t == -1) break;
              if (ch == '=') 
              {
                  ch1 = (char)(in.read()); if (ch1 == '\n') continue;
                  ch2 = (char)(in.read());
                  hz =(char) ((ch1>'9'?ch1-'A'+10:ch1-'0')*16+(ch2>'9'?ch2-'A'+10:ch2-'0'));
                /* if (ch1>=65)
                   ch1-=55;
                 else ch1-=48;
                 if (ch2>=65)
                   ch2-=55;
                 else ch2-=48;
                 hz=(char)(ch1<<4);
                 hz|=ch2; 
               */
                str = new Character(hz).toString();    
                byte[] b = str.getBytes("GB2312");
                str = new String(b,"8859_1");
                out.write(str);
                out.flush();
              }
              else out.write(ch);         
              out.flush();
            
           }
    }catch(Exception e){}    }
    }to yangzi(笨笨) :
      你看我上面的改写有错吗?他还是输出“?”
    不知道是什么原因!