summaryrefslogtreecommitdiffstats
path: root/modules/base/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base/template.go')
-rw-r--r--modules/base/template.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/base/template.go b/modules/base/template.go
index 1442bf0e84..bc69bb3b37 100644
--- a/modules/base/template.go
+++ b/modules/base/template.go
@@ -55,6 +55,9 @@ func ShortSha(sha1 string) string {
func DetectEncoding(content []byte) (string, error) {
detector := chardet.NewTextDetector()
result, err := detector.DetectBest(content)
+ if result.Charset == "ISO-8859-1" {
+ return setting.AnsiCharset, err
+ }
return result.Charset, err
}