I want to get the language of a page. I know what are W3C recommendations for this and that this can be done by reading the source and parsing the HTML and META and XHTML tags.

But the issue is, that many sites do not follow the W3C standards and therefore, they do not have any meta information about the language. In such cases, is there a free API or something that I can use to get the langauge of a website ?

please help