package middleware import "net/http" // ForceUTF8Middleware forces the browser to interpret HTML as UTF-8 for all responses. func ForceUTF8Middleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") next.ServeHTTP(w, r) }) }