mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-16 12:05:30 +09:00
#2185 fall back to use custom chardet lib
This commit is contained in:
1 parent
a62290de52
commit
4993ab1a76
8 files changed
+22
-17
No files matched your search
+2
-2
@@ -246,8 +246,8 @@ func ParsePatch(maxlines int, reader io.Reader) (*Diff, error) {
|
||||
buf.WriteString("\n")
|
||||
}
|
||||
}
|
||||
charsetLabel := base.DetectEncoding(buf.Bytes())
|
||||
if charsetLabel != "UTF-8" {
|
||||
charsetLabel, err := base.DetectEncoding(buf.Bytes())
|
||||
if charsetLabel != "UTF-8" && err == nil {
|
||||
encoding, _ := charset.Lookup(charsetLabel)
|
||||
if encoding != nil {
|
||||
d := encoding.NewDecoder()
|
||||
|
||||
Reference in new issue
Block a user