mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-23 05:42:33 +09:00
Backport #36149
This commit is contained in:
@@ -312,11 +312,13 @@ func EditFile(ctx *context.Context) {
|
||||
ctx.ServerError("ReadAll", err)
|
||||
return
|
||||
}
|
||||
var fileContent string
|
||||
if content, err := charset.ToUTF8(buf, charset.ConvertOpts{KeepBOM: true}); err != nil {
|
||||
ctx.Data["FileContent"] = string(buf)
|
||||
fileContent = string(buf)
|
||||
} else {
|
||||
ctx.Data["FileContent"] = content
|
||||
fileContent = string(content)
|
||||
}
|
||||
ctx.Data["FileContent"] = fileContent
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user