tyr.kassat
tyr.kassat

Reputation: 108

Does html charset apply to the markup or the content or both?

I'm wondering if something like this:

Content-Type: text/html; charset=<some encoding>

means that the markup tags are also in <some encoding> or if it only refers to the content.

Full example:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Super_Awesome_Encoding">
</head>
<body>
Some content!
</body>
</html>

Are the markup tags <html>, <body>, etc encoded as Super_Awesome_Encoding or just the string "Some content!" ?

Is there a difference if the charset is set via an http header such as:

Content-Type: text/html; charset=Super_Awesome_Encoding

?

Upvotes: 1

Views: 105

Answers (1)

Quentin
Quentin

Reputation: 943548

It refers to the entire file (note that it is a claim and that it is possible for the actual encoding to differ, this is likely to lead to undesired effects).

Upvotes: 4

Related Questions