Bug 46805 prepare Compare for encoding support
I20031111 The Compare plugin only supports the global workspace encoding. It does not support encodings per file.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
if (selected == null)
				return;	
								
			ICompilationUnit cu2= cu;
			if (parent instanceof IMember)
				cu2= ((IMember)parent).getCompilationUnit();
			
			CompilationUnit root= AST.parsePartialCompilationUnit(cu2, 0, false);
			
			ASTRewrite rewriter= new ASTRewrite(root);
			
			List list= getContainerList(parent, root);
			if (list == null) {
				MessageDialog.openError(shell, errorTitle, errorMessage);
				return;					
			}
			
			int pos= getIndex(root, input, list);
							
			ITypedElement[] results= d.getSelection();
			for (int i= 0; i < results.length; i++) {
								
				ASTNode newNode= createASTNode(rewriter, results[i], buffer.getLineDelimiter());
				if (newNode == null) {
					MessageDialog.openError(shell, errorTitle, errorMessage);
					return;					
				}			
				if (pos < 0 || pos >= list.size()) {
					if (newNode instanceof BodyDeclaration) {
						pos= ASTNodes.getInsertionIndex((BodyDeclaration)newNode, list);