It's pretty much always wrong to give a page the content type of "text/html". Browsers will then guess the encoding based on wonky heuristics about the page, which in certain obscure cases can lead to security problems (see <
https://en.wikipedia.org/wiki/UTF-7#Security>).
So, in addition to whatever other fix is done here, the encoding on the error page should be adjusted to be explicit about its character set.