JSREF
HTML DOM Document charset
Get the character encoding for a document: