diff options
Diffstat (limited to 'routers/web/repo/editor.go')
-rw-r--r-- | routers/web/repo/editor.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go index 5e7cd1caa3..85d40e7820 100644 --- a/routers/web/repo/editor.go +++ b/routers/web/repo/editor.go @@ -166,8 +166,8 @@ func editFile(ctx *context.Context, isNewFile bool) { } buf = append(buf, d...) - if content, err := charset.ToUTF8WithErr(buf); err != nil { - log.Error("ToUTF8WithErr: %v", err) + if content, err := charset.ToUTF8(buf, charset.ConvertOpts{KeepBOM: true}); err != nil { + log.Error("ToUTF8: %v", err) ctx.Data["FileContent"] = string(buf) } else { ctx.Data["FileContent"] = content |