iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-17-2004, 05:31 PM
MrLeN's Avatar
WebProWorld Veteran
 
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 381
MrLeN RepRank 0
Default http-equiv="Content-Type"

<META http-equiv="Content-Type" content="text/html; charset=utf-8">

I am pretty sure that there is an alterntive for:

http-equiv="Content-Type"

..but I can't remember what it is.

Does anyone know?

MrLeN
Reply With Quote
  #2 (permalink)  
Old 11-18-2004, 05:29 AM
paulhiles's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: UK
Posts: 2,089
paulhiles RepRank 0
Default Content types are also known as MIME types

Quote:
I am pretty sure that there is an alterntive for:

http-equiv="Content-Type"
Content types denote what kind of file is being transmitted over the Web. Files are tagged according to the MIME standard, using type designations like text/plain, text/html, image/jpeg, or video/quicktime. Type designations that are not officially registered have an x- prefix, like audio/x-midi or application/x-javascript. The Internet Assigned Numbers Authority (IANA) maintains the official registry of content types.

They are sometimes referred to as mime types, maybe that is causing the confusion?

MIME content types are the standard way of denoting the nature of a file transmitted over the Web. Originally, the e-mail protocol supported only plain text. MIME (Multipurpose Internet Mail Extensions) were originally devised to tag e-mail with content types, allowing people to send images, audio, video, programs or other sorts of files. Over time, these content types were used to label content types in many other Internet protocols.

Source
Reply With Quote
  #3 (permalink)  
Old 11-18-2004, 05:40 AM
paulhiles's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: UK
Posts: 2,089
paulhiles RepRank 0
Default Serving up XHTML with the correct MIME type

There is a great explanation of the correct way to "serve up" XHTML with the correct mime type here:

Serving up XHTML with the correct MIME type

A PHP code sample is illustrated showing how you might deliver the correct header appropriate to the host server.

Useful Reference:
Mime Types List - shows you a list of common MIME types and their corresponding file extensions.

The important thing to remember is the purpose of the Content-type meta tag. By using the Content-type (mime type), you are effectively telling a user agent (Web browser, PDA, etc) what sort of content is contained within your document. This can be read from the document's header without the need to explore the body of the file.
Reply With Quote
  #4 (permalink)  
Old 11-19-2004, 09:46 AM
MrLeN's Avatar
WebProWorld Veteran
 
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 381
MrLeN RepRank 0
Default

Yeah, but when I run my tidy tool it tells me:

Quote:
Warning: <meta> unrecognized attribite value "http-equiv"
I think I get this arror because this tag is meant for xhtml.

All I am trying to do is display the doctype. The one I have works fine, and validates at W3C:

Quote:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
I am 1000.1% sure that I came across this problem before and found alternative code to use, that didn't get rejected by my tidy tool.

I just can't quite remember. All I am looking for is for a valid way to include the charset for html 4.0

MrLeN
Reply With Quote
  #5 (permalink)  
Old 11-19-2004, 10:34 AM
paulhiles's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: UK
Posts: 2,089
paulhiles RepRank 0
Default Validating charset

Have you tried using the typical Western Latin (1) charset? OR just using lower-case?

Code:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
trailing end slash is just for XHTML, you can remove for HTML 4.0

Personally, I would validate by the W3C standards rather than HTML Tidy, however neat a utility it may be! :o)
Useful reference for international charsets

Paul
Reply With Quote
  #6 (permalink)  
Old 11-19-2004, 11:42 AM
MrLeN's Avatar
WebProWorld Veteran
 
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 381
MrLeN RepRank 0
Default

I am validating with W3C and I am using:

Quote:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
..and it's all cool. It wont validate with the trailing back slash of course, so I removed it.

However, every time I try to tidy a page, which I do after editing, every time, to make sure that there aren't any rogue <div>'s it takes away the http-equiv="Content-Type" part :(

I am using the Tidy Tool that comes with 1stPage

The tidy tool is pretty popular, as far as I know. It was written by Dave Raggett of W3C, but it has a copyright of 1999. Maybe in 1999 http-equiv="Content-Type" wasn't used?

Anyway, I am absolutely convinced that there's another way to include the utf8 charset. I have come across this same problem before.

There's some code that W3C and my tidy tool sees as valid. I am quite sure.

MrLeN
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:02 PM.



Search Engine Optimization by vBSEO 3.3.0