Skip to content

Commit

Permalink
Remove BOM header
Browse files Browse the repository at this point in the history
  • Loading branch information
kookxiang committed Aug 2, 2016
1 parent 8d70a29 commit 6a56fa4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
. "./TiebaSign"
"bytes"
"container/list"
"flag"
"fmt"
Expand All @@ -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)
Expand Down

0 comments on commit 6a56fa4

Please sign in to comment.