Reputation: 464
When the character set is not specified either in httpd.conf, or php.ini, or .htaccess etc, then what is the default character set used by the apache server/php?
The browser considers it to be ISO-8859-1 when the response header does not include any character set information but I could not find any confirmation that the apache server/php actually sends the data with ISO-8859-1 encoding in response.
Thanks
Upvotes: 3
Views: 10187
Reputation: 173562
The default value for default_charset
is "iso-8859-1"
, which is applied to all pages served by PHP.
For Apache, the default character set for text and html is mandated by AddDefaultCharset
which also has a default of "iso-8859-1"
.
Upvotes: 2
Reputation: 2412
I'm not completely sure, but Apache does not produce output, it just serves it. So it all depends on how resources are encoded, it's not up to Apache to encode them.
Even if you specify a charset, it's just a hint for the browser. You can set a utf-8
charset via php or via Apache, but if the served resource is encoded with a different one, your browser will just show bad encoded data.
If there's no charset set, then your browser has to guess (or use a default charset).
Upvotes: 2