mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-02 12:23:39 +00:00
fix: charset lookup (#39187)
This commit is contained in:
@@ -42,7 +42,6 @@ import (
|
||||
|
||||
"github.com/alecthomas/chroma/v2"
|
||||
"github.com/sergi/go-diff/diffmatchpatch"
|
||||
stdcharset "golang.org/x/net/html/charset"
|
||||
"golang.org/x/text/encoding"
|
||||
"golang.org/x/text/transform"
|
||||
)
|
||||
@@ -947,7 +946,7 @@ parsingLoop:
|
||||
}
|
||||
charsetLabel, _ := charset.DetectEncoding(buffer.Bytes())
|
||||
if charsetLabel != "UTF-8" {
|
||||
charsetEncoding, _ := stdcharset.Lookup(charsetLabel)
|
||||
charsetEncoding, _ := charset.Lookup(charsetLabel)
|
||||
if charsetEncoding != nil {
|
||||
diffLineTypeDecoders[lineType] = charsetEncoding.NewDecoder()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user