It's necessary to copy the global 'fileencoding' to the buffer-local value before entering the buffer, otherwise 'fileencoding' is changed when reading the file, which will mark the file as modified.
assert.is_true()