S
Sven Köhler
Am 23.11.2012 19:21, schrieb Jan Burse:
Scenario 3:
Apache configuration sets a default charset and sends Content-Type:
text/html; charset=iso-8859-1 even though the meta tag in the file
specifies utf8.
Luckily, this feature could be turned off. I'm not sure, what the
default config is at the moment. Also, I don't know of any webserver
that actually implements scenario 2. Mostly, specifying the charset in
the HTTP header is used by dynamic webpages (JSP, PHP, ASP), as they
allow setting the headers.
Also, why is this discussion in the Java newsgroup?
Just because Java asks programmer to specify the charset sometimes?
Regards,
Sven
For example when you edit a HTML file locally, you don't
have this HTTP header information. Also where does the HTTP
header get the charset information in the first place?
Scenario 1:
- HTTP returns only mimetype=text/html without
the chartset option.
- The browser then reads the HTML doc meta tag, and
adjust the charset.
Scenario 2:
- HTTP returns mimetype=text/html; charset=<encoding>
fetched from the HTML file meta tag.
- The browser does not read the HTML doc meta tag, and
follows the charset found in the mimetype.
In both scenarios 1 + 2, the meta tag is used. Don't
know whether there is a scenario 3, and where should
this scenario take the encoding from?
Scenario 3:
Apache configuration sets a default charset and sends Content-Type:
text/html; charset=iso-8859-1 even though the meta tag in the file
specifies utf8.
Luckily, this feature could be turned off. I'm not sure, what the
default config is at the moment. Also, I don't know of any webserver
that actually implements scenario 2. Mostly, specifying the charset in
the HTTP header is used by dynamic webpages (JSP, PHP, ASP), as they
allow setting the headers.
Also, why is this discussion in the Java newsgroup?
Just because Java asks programmer to specify the charset sometimes?
Regards,
Sven