This commit is contained in:
Liang Ding 2015-04-01 10:43:38 +08:00
parent 6f5d1fe086
commit fec7480be9
1 changed files with 1 additions and 5 deletions

View File

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