mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
#2185 use Go sub-repo to detect encoding
This commit is contained in:
@@ -127,11 +127,7 @@ func Sha1(str string) string {
|
||||
}
|
||||
|
||||
func ToUtf8WithErr(content []byte) (error, string) {
|
||||
charsetLabel, err := base.DetectEncoding(content)
|
||||
if err != nil {
|
||||
return err, ""
|
||||
}
|
||||
|
||||
charsetLabel := base.DetectEncoding(content)
|
||||
if charsetLabel == "UTF-8" {
|
||||
return nil, string(content)
|
||||
}
|
||||
|
Reference in New Issue
Block a user