日期:2014-05-20 浏览次数:20787 次
String str = "/n中文测试,这是内部硬编码的串 " + "/ntest english character";
String strin = "";
BufferedReader stdin = new BufferedReader(new InputStreamReader(new FileInputStream("E:/test.txt"), "gb2312"));
// 设置输入接口按中文编码
BufferedWriter stdout = new BufferedWriter(new OutputStreamWriter(System.out, "gb2312"));
// 设置输出接口按中文编码
stdout.write("请输入:");
stdout.flush();
strin = stdin.readLine();
stdout.write("这是从用户输入的串:" + strin);
stdout.write(str);
stdout.flush();