views:

60

answers:

3

I own a website that was recently moved to a different server, now I can see some weird characters. Initially the website was coded with UTF-8 encoding. The weird characters disappears if I change the View > Character encoding to Western(8859-1) in my browser. Therefore, I changed the source of the website to use this Western one, but still I can see the weird characters and they doesn't seem to disappear. Can anyone help me with this. Thanks in advance.

A: 

If you have access to Linux/Unix command line, use the following command to find out the encoding sent by your server: ($ is not part of the command)

$ curl -s --head http://yoursite.com | grep Content-Type

Alternative you can use e.g. Firebug plugin for Firefox to find out value of the Content-Type header sent by the server.

The content type sent by server usually overrides the encoding specified in the document, so it's not enough to just change your http-meta-equiv.

jholster
A: 

It's odd that you get correct chars when browser forcing ISO-8859-1 if your site is coded in UTF-8. It makes no sense. So unless there is some on-the-fly charset conversion going in in the web server, I suspect that your html is in fact Latin-1 encoded (or at least parts of it).

Martin Wickman
+1  A: 

To me, this sounds like your websites were encoded with ISO 8859-1 (rather than UTF-8), but the server sends out the page as UTF-8 instead.

To verify this, you can install Live HTTP Headers for Firefox and check the Content-Type header of the web server response.

If the server indeed sends out the wrong Content-Type, you need to change the server configuration. Since you didn't tell us which web server you use, I cannot give you more specific instructions. ;-)

Heinzi