Solved

Charset specified in a meta tag

Posted on 2013-11-25
7
1,873 Views
Last Modified: 2013-11-25
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.
0
Comment
Question by:livewirewebsolutions
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 133 total points
ID: 39674972
assuming apache, add to your .htaccess file in root directory:

AddDefaultCharset UTF-8
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 132 total points
ID: 39675043
IE8 (eight?)

I would recommend that you use the HTML5 doctype, like this, and do browser detection.  If any of your clients are still using IE8, you can put a notice on the screen with a link to the current browsers!

<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="utf-8" />
...

Open in new window

0
 

Author Comment

by:livewirewebsolutions
ID: 39675064
Hi Ray,

but I heard you are supposed to avoid a charset in the meta tag?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39675108
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.
0
 

Author Comment

by:livewirewebsolutions
ID: 39675231
What about using it in the htaccess file?
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39675286
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.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39675314
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.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question