Solved

Charset specified in a meta tag

Posted on 2013-11-25
7
1,814 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
7 Comments
 
LVL 32

Accepted Solution

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

AddDefaultCharset UTF-8
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 132 total points
Comment Utility
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
Comment Utility
Hi Ray,

but I heard you are supposed to avoid a charset in the meta tag?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Comment Utility
What about using it in the htaccess file?
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now