mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 03:58:28 +02:00
#2185 use Go sub-repo to detect encoding
This commit is contained in:
1 parent
79dcd7ee6e
commit
95f9c85bcc
7 files changed
+11
-21
No files matched your search
+2
-2
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user