关于记事本跨平台问题 用string的编码方式进行转化应该可以吧。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 . .- .- ./ .--... .-------- 0 .-- / ....... ' .. '........ ---- . --.. . .---.. - 分 o . ' -. 分 / ' / ' ' ' \-分--/....... . ' ' ' ' \ __/ - - -' ' ' ' ' ' ' ' o ' ' ' ' ' ' ' -..'.----------. I ---------- /////////. 我从中文拷贝一个内容是中文的记事本文件到日文系统,然后用package test;import java.io.*;public class CodingTest { public CodingTest() { } public static void write(String fromEncoding, String toEncoding) throws Exception { FileInputStream fin = new FileInputStream("c:/a.txt"); BufferedReader in = new BufferedReader(new InputStreamReader(fin, fromEncoding)); FileOutputStream fout = new FileOutputStream("c:/aa.txt"); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fout, toEncoding)); String str; while ( (str = in.readLine()) != null) { out.write(str, 0, str.length()); out.newLine(); out.flush(); } } public static void main(String args[]) throws Exception { write("GB2312", "UTF8");// write("GB2312", "MS932"); }}用这个程序读出写入到aa.txt中,发现有部分是乱码。部分不是乱码。不是乱码的是日文系统,中文系统中都存在的字,不存在的为?号。 问一个比较小白的问题,莫鄙视啊。[java子类继承父类时不同返回类型的方法无法继承?那么如何重载] java comm包怎么安装? 关于按纽的问题???? java生成二叉树的小问题 jxl问题 我在服务器端用jxl读写了一个excel文件 下下来 居然文件未找到,然后修复才看到 关于字母输出的问题 问个上下无关文法的问题,实在不知道该发哪了,请高手帮帮忙,在线等 JTextArea的问题,实现象qq的功能,在线等啊 送分了 第一个解答有分! Linux下RMI调用出现的奇怪问题!! 挺好的一个FTP,挺多java的学习资料,推荐一下! 请问:从数据库中查找数据如何判断,没有查找到数据
./ .--...
.-------- 0 .--
/ .......
' ..
'........ ----
. --..
. .---.. -
分 o . ' -.
分 / '
/ ' ' '
\-分--/....... . ' ' ' '
\ __/ - - -' ' ' '
' ' ' '
o ' ' ' '
' ' '
-..'.----------.
I ----------
/////////.
package test;import java.io.*;public class CodingTest {
public CodingTest() {
} public static void write(String fromEncoding, String toEncoding) throws
Exception {
FileInputStream fin = new FileInputStream("c:/a.txt");
BufferedReader in = new BufferedReader(new InputStreamReader(fin,
fromEncoding));
FileOutputStream fout = new FileOutputStream("c:/aa.txt");
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fout,
toEncoding)); String str; while ( (str = in.readLine()) != null) {
out.write(str, 0, str.length());
out.newLine();
out.flush(); }
} public static void main(String args[]) throws Exception {
write("GB2312", "UTF8");
// write("GB2312", "MS932");
}
}
用这个程序读出写入到aa.txt中,发现有部分是乱码。部分不是乱码。不是乱码的是日文系统,中文系统中都存在的字,不存在的为?号。