set charset on html content type

This commit is contained in:
maddalax 2024-10-26 21:41:21 -05:00
parent b218a75ea8
commit 2726c60608
2 changed files with 2 additions and 2 deletions

View file

@ -251,7 +251,7 @@ func writeHtml(w http.ResponseWriter, element Ren) error {
if element == nil { if element == nil {
return nil return nil
} }
w.Header().Set("Content-Type", "text/html") w.Header().Set("Content-Type", "text/html; charset=utf-8")
_, err := fmt.Fprint(w, Render(element, WithDocType())) _, err := fmt.Fprint(w, Render(element, WithDocType()))
return err return err
} }

View file

@ -1,6 +1,6 @@
## Other languages and related projects ## Other languages and related projects
If you are not a Go user but are interested in the idea of what htmgo is, you might want to check out these other projects: If you're not a Go user but are interested in the idea of what htmgo is, you might want to check out these other projects:
#### Python #### Python
- [fastht.ml](https://fastht.ml/) - Modern web applications in pure Python, Built on solid web foundations, not the latest fads - with FastHTML you can get started on anything from simple dashboards to scalable web applications in minutes. - [fastht.ml](https://fastht.ml/) - Modern web applications in pure Python, Built on solid web foundations, not the latest fads - with FastHTML you can get started on anything from simple dashboards to scalable web applications in minutes.