Skip to content

Commit a36a484

Browse files
committed
Fix: gbk and params
1 parent 31e25d2 commit a36a484

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ var srcFiles SrcFiles
4141
func init() {
4242
flag.StringVar(&encode, "code", "", "support GBK,UTF-8")
4343
flag.StringVar(&zipPath, "zipPath", "", "zip file path")
44-
flag.StringVar(&distDirPath, "DistDirPath", "", "dir path")
45-
flag.Var(&srcFiles, "file", "--file 1.txt --file 2.txt --file 3.txt")
44+
flag.StringVar(&distDirPath, "distDirPath", "", "dir path")
45+
flag.Var(&srcFiles, "file", "-file 1.txt -file 2.txt -file 3.txt")
4646
flag.IntVar(&mode, "mode", ZIP_MODE, "1=zip, 2=unzip")
4747
}
4848

@@ -154,7 +154,7 @@ func UnZip(distDirPath, zipPath string) {
154154
// 第二步,遍历 zip 中的文件
155155
for _, f := range zipFile.File {
156156
filePath := f.Name
157-
if encode == "GBK" {
157+
if encode == "gbk" {
158158
i := bytes.NewReader([]byte(f.Name))
159159
decoder := transform.NewReader(i, simplifiedchinese.GB18030.NewDecoder())
160160
content, _ := ioutil.ReadAll(decoder)

0 commit comments

Comments
 (0)