Anirudha
Anirudha

Reputation: 32817

lang attribute Vs meta tags charset attribute

The w3c points out the use of lang attribute as

Assisting search engines

Assisting speech synthesizers

Helping a user agent select glyph variants for high quality typography

Helping a user agent choose a set of quotation marks

Helping a user agent make decisions about hyphenation, ligatures, and spacing

Assisting spell checkers and grammar checkers

But I found nothing useful for charset attribute of meta tag except for encoding the document

Do charset provide the same functionality as the lang attribute such as assisting speech synthesizers,search engines.......

Upvotes: 5

Views: 4313

Answers (2)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201866

It’s easier to say what they have in common: nothing. Well, except for being metadata of some kind and for being relevant in internationalization.

And the correct form is <meta charset="encoding name">, such as <meta charset=utf-8>. It’s not about languages but about the interpretation of bytes in the document as characters. Some encodings have been developed for specific languages, but encoding and language are still quite distinct concepts.

<meta charset="..."> is HTML5 shorthand for

<meta http-equiv="Content-Type" content="text/html;charset=...">, which is described here

Upvotes: 6

shutter
shutter

Reputation: 46

The meta-tag defines your used charset/encoding like UTF-8, ISO-8859-1 or something like that. While the html lang tag defines the used language like en-EN, de-DE and so on.

Upvotes: 2

Related Questions