使用ava.io.Filef=newjava.io.File("/home/multiverse/Repository/PMEPGImport")的方式读取文件,如文件名称含有中文,则读取结果文件名称中文部分乱码,且显示文件不存在。我试过设置...
使用ava.io.File f = new java.io.File("/home/multiverse/Repository/PMEPGImport")的方式读取文件,如文件名称含有中文,则读取结果文件名称中文部分乱码,且显示文件不存在。
我试过设置:
System.setProperty("file.encoding","GBK");
System.setProperty("sun.jnu.encoding","GBK");
不起作用;
试过将文件名称进行如下转码:
String s0= new String(S.getBytes("UTF-8"),"GB2312");
String s1= new String(S.getBytes("GB2312"),"UTF-8");
String s2= new String(S.getBytes("ISO-8859-1"),"UTF-8");
String s3= new String(S.getBytes("UTF-8"),"ISO-8859-1");
String s4= new String(S.getBytes("ISO-8859-1"),"GB2312");