Save the current file encoding when the document is closed.