人员文件导入乱码动态处理
This commit is contained in:
parent
a25fd6b832
commit
e2ee7bc418
|
|
@ -418,6 +418,14 @@ public class ImportServiceImpl implements ImportService {
|
|||
ZipFile zipFile = new ZipFile(path);
|
||||
zipFile.setFileNameCharset(encoding);
|
||||
List<FileHeader> list = zipFile.getFileHeaders();
|
||||
//判断文件名是否乱码
|
||||
if (isMessyCode(list.get(0).getFileName())) {
|
||||
encoding = "UTF-8";
|
||||
//对文件名进行重新编码
|
||||
zipFile = new ZipFile(path);
|
||||
zipFile.setFileNameCharset(encoding);
|
||||
list = zipFile.getFileHeaders();
|
||||
}
|
||||
Set<String> uniqueNames = new HashSet<>();
|
||||
String beforeName = "";
|
||||
StringBuilder folderName = new StringBuilder();
|
||||
|
|
|
|||
Loading…
Reference in New Issue