From 53bcf373c1d076dd14db6aff0247ae9dbdc49c77 Mon Sep 17 00:00:00 2001 From: Vladimir Vissoultchev Date: Mon, 27 Jul 2015 21:58:51 +0300 Subject: Allow explicit charset/codepage setting for ANSI source files to alleviate issue #1088 --- modules/base/template.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/base/template.go') 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 } -- cgit v1.2.3