This commit is contained in:
parent
6f5d1fe086
commit
fec7480be9
|
@ -152,19 +152,15 @@ func cloneZipItem(f *zip.File, dest string) error {
|
||||||
// create full directory path
|
// create full directory path
|
||||||
fileName := f.Name
|
fileName := f.Name
|
||||||
|
|
||||||
fmt.Println(fileName)
|
|
||||||
if !utf8.ValidString(fileName) {
|
if !utf8.ValidString(fileName) {
|
||||||
fmt.Println("!utf8")
|
|
||||||
data, err := ioutil.ReadAll(transform.NewReader(bytes.NewReader([]byte(fileName)), simplifiedchinese.GB18030.NewDecoder()))
|
data, err := ioutil.ReadAll(transform.NewReader(bytes.NewReader([]byte(fileName)), simplifiedchinese.GB18030.NewDecoder()))
|
||||||
if nil == err {
|
if nil == err {
|
||||||
fileName = string(data)
|
fileName = string(data)
|
||||||
} else {
|
} else {
|
||||||
fmt.Println(err)
|
logger.Error(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(fileName)
|
|
||||||
|
|
||||||
path := filepath.Join(dest, fileName)
|
path := filepath.Join(dest, fileName)
|
||||||
|
|
||||||
err := os.MkdirAll(filepath.Dir(path), os.ModeDir|os.ModePerm)
|
err := os.MkdirAll(filepath.Dir(path), os.ModeDir|os.ModePerm)
|
||||||
|
|
Loading…
Reference in New Issue