Welcome Guest, Not a member yet? Register   Sign In
Strange Content-Type header
#1

[eluser]bAum[/eluser]
Dear All,

I am currently having a problem with with the encoding of the page. The problem is that what is sent is encoded in UTF-8, yet the browser thinks its ISO-8859-1. This is because one of the HTTP headers that is sent along with the page reads:

Code:
Content-Type: text/html;charset=iso-8859-1

I don't see where this header is coming from, given that:
- The charset setting in the config file of CodeIgniter is set to "UTF-8".
- In the php.ini, no default charset is set.
- I have a meta-header that reads <meta http-equiv="content-type" content="text/html;charset=UTF-8">

Yet for some strange reason, this ISO-8859-1 is set as part of the headers (it is actually the last header, the whole sequence being Response, Date, Server, X-Powered-By, Set-Cookie, Set-Cookie, Set-Cookie, Keep-Alive, Connection, Transfer-Encoding, Content-Type).

Does anyone have an idea what piece of code is actually setting this header, or whether it hasn't anything to do with CI in the first place?

Any help appreciated.

Cheers,

baum
#2

[eluser]bAum[/eluser]
Now after some trying around, the header "Content-Type: text/html;charset=iso-8859-1" is gone, I don't know how that happened, maybe because I cleared the cache and restarted Firefox.

My output is now displaying correctly.
#3

[eluser]bAum[/eluser]
Again posted too quickly.

It wasn't clearing the cache and restarting Firefox that caused that header to disappear, but my colleague who was looking into the same problem. It turns out that there is a directive in Apache's httpd.conf that allows to add a header with a default charset (iso-8859-1) in case no such header is present. He disabled that directive around the time I cleared the Firefox cache, leading me to the wrong conclusion Smile




Theme © iAndrew 2016 - Forum software by © MyBB