Fix UTF-8 in upper-case, use ansi charset for all non UTF-8 encodings

This commit is contained in:
Vladimir Vissoultchev 2015-07-29 17:58:03 +03:00
parent 4917d29c12
commit 2cc050e21e
3 changed files with 4 additions and 4 deletions

View file

@ -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 {