Encoding property of document is never set