String hello = "你好";
FileOutputStream out = new FileOutputStream("d:/data.txt");
if (out != null) {
for (int i = 0; i < hello.length(); i++) {
out.write(hello.charAt(i));
}
out.close();
}
string中的中文在txt文件中都成了乱码,怎么办?
...全文
1265打赏收藏
输出txt文件的中文乱码怎么解决,急
String hello = "你好"; FileOutputStream out = new FileOutputStream("d:/data.txt"); if (out != null) { for (int i = 0; i < hello.length(); i++) { out.write(hello.charAt(i)); } out.close(); } string中的中文在txt文件中都成了乱码,怎么办?