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
public void bufferCreated(IFileBuffer buffer) {
			
			if (buffer.getLocation().equals(fFile.getFullPath()) && buffer instanceof ITextFileBuffer) {
				ITextFileBuffer textBuffer= (ITextFileBuffer)buffer;				
				if (fDocumentListener == null)
					fDocumentListener= new DocumentChangedListener();
				textBuffer.getDocument().addDocumentListener(fDocumentListener);
			}
			
		}
		public void bufferDisposed(IFileBuffer buffer) {
			
			if (fDocumentListener != null && buffer.getLocation().equals(fFile.getFullPath())) {
				if (buffer instanceof ITextFileBuffer) {
					ITextFileBuffer textBuffer= (ITextFileBuffer)buffer;
					textBuffer.getDocument().removeDocumentListener(fDocumentListener);
					fDocumentListener= null;
				}
				fContentStamp= fFile.getModificationStamp();
			}
			
		}
		public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {
		}
		public void bufferContentReplaced(IFileBuffer buffer) {
		}
		public void stateChanging(IFileBuffer buffer) {