Having spent a few hours trying to figure out why the server was not returning a character set was frustrating. Even though I had a charset in the webpage, the server was not returning a charset.
And why is this a security risk?
A nefarious person could upload a web page in a different character set, say UTF-7, with harmful code in it. When the web page is accessed, the server accepts the UTF-7 encoding and executes the script.
Check to see if the server returns a charset by entering your web page here. On the results page, under ‘Receiving Header:’, the content-type should be something like: text/html; charset=iso-8859-1
If the charset is missing it will be: text/html
I fixed my site, which uses Apache server, by including:
AddDefaultCharset ISO-8859-1
in the .htaccess file. You can contact your host to see if they can fix it at their end, but on shared hosting it may be difficult.