label-tool: send pages as UTF-8

This commit is contained in:
Přemysl Eric Janouch 2019-04-25 21:33:20 +02:00
parent 2f47b3f5da
commit e56482d73f
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ func handle(w http.ResponseWriter, r *http.Request) {
if fontIndex, err = strconv.Atoi(r.FormValue("font")); err == nil { if fontIndex, err = strconv.Atoi(r.FormValue("font")); err == nil {
font = fonts[fontIndex] font = fonts[fontIndex]
} else { } else {
w.Header().Set("Content-Type", "text/html") w.Header().Set("Content-Type", "text/html; charset=utf-8")
if err := tmplFont.Execute(w, fonts); err != nil { if err := tmplFont.Execute(w, fonts); err != nil {
http.Error(w, err.Error(), 500) http.Error(w, err.Error(), 500)
} }
@ -217,7 +217,7 @@ func handle(w http.ResponseWriter, r *http.Request) {
} }
if _, ok := r.Form["render"]; !ok { if _, ok := r.Form["render"]; !ok {
w.Header().Set("Content-Type", "text/html") w.Header().Set("Content-Type", "text/html; charset=utf-8")
if err := tmplForm.Execute(w, &params); err != nil { if err := tmplForm.Execute(w, &params); err != nil {
http.Error(w, err.Error(), 500) http.Error(w, err.Error(), 500)
} }