Set the document encoding according to the global configuration