fix charset gbk and gb2312

This commit is contained in:
fengdingbo
2020-12-20 01:16:08 +08:00
parent be4905ce2e
commit 315cdf7e4b
+2 -1
View File
@@ -20,7 +20,8 @@ func ExtractTitle(r *Response) (title string) {
contentType := strings.Join(contentTypes, ";")
// special cases
if strings.Contains(contentType, "charset=GB2312") {
if strings.Contains(strings.ToLower(contentType), "charset=gb2312") ||
strings.Contains(strings.ToLower(contentType), "charset=gbk") {
titleUtf8, err := Decodegbk([]byte(title))
if err != nil {
return