From 6a56fa4c11b7a38698c9b6461047eb85b66470d0 Mon Sep 17 00:00:00 2001 From: kookxiang Date: Tue, 2 Aug 2016 12:25:04 +0800 Subject: [PATCH] Remove BOM header --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index fb45653..aadaa16 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( . "./TiebaSign" + "bytes" "container/list" "flag" "fmt" @@ -22,6 +23,7 @@ func getCookie(cookieFileName string, silence bool) (cookieJar *cookiejar.Jar, h cookies := make([]*http.Cookie, 0) if _, err := os.Stat(cookieFileName); err == nil { rawCookie, _ := ioutil.ReadFile(cookieFileName) + rawCookie = bytes.Trim(rawCookie, "\xef\xbb\xbf") rawCookieList := strings.Split(strings.Replace(string(rawCookie), "\r\n", "\n", -1), "\n") for _, rawCookieLine := range rawCookieList { rawCookieInfo := strings.SplitN(rawCookieLine, "=", 2)