Skip to content

Commit

Permalink
如果识别字符编码为windows-1252则将其默认转换成gbk
Browse files Browse the repository at this point in the history
  • Loading branch information
ystyle committed Mar 10, 2020
1 parent f79ce15 commit c3be030
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func readBuffer(filename string) *bufio.Reader {
var buf bytes.Buffer
decoder = encodig.NewDecoder()
if encodename == "windows-1252" {
decoder = simplifiedchinese.GBK.NewDecoder()
decoder = simplifiedchinese.GB18030.NewDecoder()
}
bs, _, _ = transform.Bytes(decoder, bs)
buf.Write(bs)
Expand Down

0 comments on commit c3be030

Please sign in to comment.