From 95f9c85bcc8f915d823f57cd5923302dfc156504 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 13 Dec 2015 19:56:33 -0500 Subject: #2185 use Go sub-repo to detect encoding --- models/git_diff.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models/git_diff.go') diff --git a/models/git_diff.go b/models/git_diff.go index a94ea0abc7..725806699e 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -244,8 +244,8 @@ func ParsePatch(maxlines int, reader io.Reader) (*Diff, error) { buf.WriteString("\n") } } - charsetLabel, err := base.DetectEncoding(buf.Bytes()) - if charsetLabel != "UTF-8" && err == nil { + charsetLabel := base.DetectEncoding(buf.Bytes()) + if charsetLabel != "UTF-8" { encoding, _ := charset.Lookup(charsetLabel) if encoding != nil { d := encoding.NewDecoder() -- cgit v1.2.3