yangzi(笨笨)再看一下这个问题! 输入?的问题是由于unicode的问题。你在输入以前用gb2312转一下。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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(笨笨) : 你看我上面的改写有错吗?他还是输出“?”不知道是什么原因! POI生成EXCEL,公式中包含中文时乱码 关于一条正则 一个简单的函数 新手咨询 将HashMap值格式化为字符串 JDBC数据缓冲问题,GOOGLE里也没有找到解决方案,有高手没 关于图形界面的几个问题 关于对象静态常量赋值的异常捕捉问题 请大家帮我一下 我用JDK想通过JDBC连INFORMIX数据库,请问哪有驱动如何配置? JFC在IE中显示的问题 java的客户端除了APP还有什么? 我想哭!!!
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(笨笨) :
你看我上面的改写有错吗?他还是输出“?”
不知道是什么原因!