views:

12

answers:

1

I peeked inside the source of a public website which uses the XHTML 1.0 Strict DOCTYPE and noticed that it specifies two attribute related to the language of the page.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> 

The page is in Japanese by the way. My question is this:-

I suspect that the attribute xml:lang & lang do not affect the rendering of the page in the browsers. It is the Content-Type in the HTTP Header which specifies the encoding of the page. Am I correct ?

A: 

The specification says:

Language information specified via the lang attribute may be used by a user agent to control rendering in a variety of ways. Some situations where author-supplied language information may be helpful include:

  • 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

Aside from that, I wouldn't imagine it would affect layout or the document mode (quirks mode vs standards mode). PPK's Quirksmode is pretty much the standard reference when it comes to things like this, and searching that site shows no mention of the lang attribute.

nickf