Jump to content

HTML: HTML Character Encoding in Page or at Server Level?


justravis

Recommended Posts

What is the best way to declare character encoding - in page or at server level?

 

If at the server level, do I include 'text/html; charset=ISO-8859-1' as an apache handler or mime type?

 

Furthermore, if I attached them to php files, wouldn't it see the code as text instead of rendering the php?

 

Thank You.

Use both. It's best to declare it at the server level to let the browser know what is coming, but browsers also expect the meta tag, so you want it in there as well.

 

Declaring it in the header with text/html will not cause the browser to output php to the browser as text. The header is sent by the server, attached to the HTML that the php script has outputted. By this point, there is no php in the content - the php has already been processed. All that is left is the content, which is why you are declaring the content type.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.