读文件 路径含中文 处理
编译工具编码,工程文件编码,log文件编码配置,容器编码,程序编码解码
public static String loadPath(String relative_Dir) {
String root_Dir = XMLMethods.class.getResource("/").toString();
try {
root_Dir = URLDecoder.decode(XMLMethods.class.getResource("/").toString(),"utf-8");
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(XMLMethods.class.getName()).log(Level.SEVERE, null, ex);
}
return CommonMethod.getAbsoluteFilePath( root_Dir + relative_Dir);
}
浙公网安备 33010602011771号