mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Fix UTF-8 in upper-case, use ansi charset for all non UTF-8 encodings
This commit is contained in:
@@ -28,7 +28,7 @@ func ServeBlob(ctx *middleware.Context, blob *git.Blob) error {
|
||||
_, isTextFile := base.IsTextFile(buf)
|
||||
if isTextFile {
|
||||
charset, _ := base.DetectEncoding(buf)
|
||||
if charset != "utf-8" {
|
||||
if charset != "UTF-8" {
|
||||
ctx.Resp.Header().Set("Content-Type", "text/plain; charset="+charset)
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user