Bug 73656 Encoding: refactoring should flush the undo stack on encoding changes
Refactoring should flush the undo stack on encoding changes. It is questionable what to do if the encoding changes since the encoding has an impact on the number of characters. Alternativly the UndoTectFileChange could remember the encoding and could compare it in isValid(...).
org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/BufferValidationState.java
protected ModificationStamp getModificationStamp() {
		ITextFileBuffer buffer= getBuffer(fFile);
		if (buffer == null) {
			return ModificationStamp.createFile(fFile.getModificationStamp());
		} else {
			IDocument document= buffer.getDocument();
			if (document instanceof IDocumentExtension4) {
				return ModificationStamp.createDocument(((IDocumentExtension4)document).getModificationStamp());
			} else {
				return ModificationStamp.createFile(fFile.getModificationStamp());
			}
		}
	}
}
class DirtyBufferValidationState extends BufferValidationState {
	
	private IDocumentListener fDocumentListener;
	private FileBufferListener fFileBufferListener;
	private boolean fChanged;
	private long fContentStamp= IResource.NULL_STAMP;
	
	class DocumentChangedListener implements IDocumentListener {
		public void documentAboutToBeChanged(DocumentEvent event) {
		}
		public void documentChanged(DocumentEvent event) {
			DirtyBufferValidationState.this.documentChanged();
		}
	}
	
	class FileBufferListener implements IFileBufferListener {