Link to home
Start Free TrialLog in
Avatar of livewirewebsolutions
livewirewebsolutions

asked on

Charset specified in a meta tag

The following resources have a character set specified in a meta tag. Specifying a character set in a meta tag disables the lookahead downloader in IE8. To improve resource download parallelization, move the character set to the HTTP Content-Type response header.

I am using the following code: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

How do I move this to my server or place it in response header.
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of livewirewebsolutions
livewirewebsolutions

ASKER

Hi Ray,

but I heard you are supposed to avoid a charset in the meta tag?
These are the first 3 lines from Facebook (so it can't be that big an issue)

<!DOCTYPE html>
<html lang="en" id="facebook" class="no_js">
<head><meta charset="utf-8" />

Open in new window

The issue that some have been critical of has been the placement of a character-set tag deep into the document.  In theory, UTF-8 is self-evident, but many browsers will re-request the document if they encounter a character-set tag to be sure they are using the right encoding.  I think any associated performance issues are very, very small, perhaps unmeasurable.
What about using it in the htaccess file?
I don't see anything wrong with that.  The central issue is consistency across all encoding of the data.  You may find a global default character set configuration for the HTTP server, which in theory could be (slightly) more efficient than .htaccess settings.

Here is what W3 has to say: "...information in the HTTP header overrides information in the document itself."
http://www.w3.org/International/questions/qa-htaccess-charset.en

If you wanted to serve some pages in UTF-8 and some in ISO-8559-1, you would probably not want to use .htaccess, but if you know you're only working with one encoding you'll be OK either way.
I have seen a couple of questions where the server was sending a UTF-8 content type header that was totally confusing the user.  There is an awful lot of content that is in ISO-8859-x character set.  Changing the character set directive does Not change the actual character codes so you end up with a page that has question marks usually in black diamonds where the browser doesn't know what to show for that code.  One of those places is the Apache web server docs.