Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Charset specified in a meta tag

Posted on 2013-11-25
7
Medium Priority
?
1,975 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 532 total points
ID: 39674972
assuming apache, add to your .htaccess file in root directory:

AddDefaultCharset UTF-8
0
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 528 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 111

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 111

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 84

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

722 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