Solved

Charset specified in a meta tag

Posted on 2013-11-25
7
1,859 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 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 109

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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 109

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 109

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
html input 8 42
PHP Echo with auto submit 8 28
Using HTML5 and CSS How to place one element in front of another elemen 7 31
Log in through ID 5 17
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

840 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