/    Sign up×
Community /Pin to ProfileBookmark

Do browsers pay attention to the <meta http-equiv="Content-Type"..> values?

Let’s say some web page contains the following HTML code:

[code=html]<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />[/code]

I have heard that some web browsers will ignore this declaration. I have also heard that some servers will specificy in the HTTP headers which Content-Type is being used, and the http-equiv Content-Type is ignored.

Is the charset declaration ever ignored?

Can anyone enlighten me?

Thanks.

to post a comment
HTML

8 Comments(s)

Copy linkTweet thisAlerts:
@callumdauthorJan 13.2008 — Another question,

Some web servers, when sending a HTML document, will include [b]Content-Type[/b] information in the HTTP headers (not the HTML document itself, but the HTTP headers).

My question is, does the [b]Content-Type[/b] and [b]charset[/b] specified in the actual HTML document, in the [b]http-equiv[/b] tag, affect what is specified in the HTTP headers? For example, when the web server is parsing the HTML document, does it see that the HTML document has specified its own charset, and then, make sure it specifies the same charset in the HTTP headers?
Copy linkTweet thisAlerts:
@itHighway2007Jan 13.2008 — As far as google is concerned, meta tags are not so important. But it is good practice to include Charset meta tag into html page.
Copy linkTweet thisAlerts:
@ray326Jan 13.2008 — ALL web servers send content-type with each response and all web browsers make use of that content-type. It's part of the HTTP spec. Whether an http-equiv meta tag is honored by a browser is up to the browser but most do.

If you want to know how the Internet works, this is the place to go. If you're just interested in HTTP then this is it.
Copy linkTweet thisAlerts:
@callumdauthorJan 14.2008 — ALL web servers send content-type with each response[/QUOTE]
Thanks Ray,

So they do.

Do you know how a web server figures out which CHARSET it will include in the HTTP headers?

Is this a setting on the web server, and the same CHARSET will be specified in the HTTP headers every time?

Will the web server parse the HTML file before sending it, checking for a CHARSET declaration, and then match it in the HTTP headers?
Copy linkTweet thisAlerts:
@callumdauthorJan 14.2008 — According to this tutorial on charsets from the W3C, Apache has a functionality where you can set a default charset that will be sent with all HTTP requests. But what if a web server is hosting HTML files that have been encoded with different character sets? How does it "adjust" it's HTTP header accordingly?
Copy linkTweet thisAlerts:
@ray326Jan 14.2008 — Servers can be set to default to a particular charset then use other charsets based on filename and/or directory. I think if you peruse the Apache httpd.conf you'll see how Apache does it because it does a multi-lingual installation.
Copy linkTweet thisAlerts:
@callumdauthorJan 14.2008 — Alrighty, thanks again.
Copy linkTweet thisAlerts:
@root123Jan 14.2008 — As far as google is concerned, meta tags are not so important. But it is good practice to include Charset meta tag into html page.[/QUOTE]

Yes is is good to add the concerned meta tag, so as to maintain a clean coding standards as per recommended by W3 schools.
×

Success!

Help @callumd spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...