Bug 56885 problematic use of platform encoding in CompareResultDialog.CompareElement [JUnit]
M8 org.eclipse.jdt.internal.junit.ui.CompareResultDialog.CompareElement uses platform encoding to encode Unicode string. This may result in data loss if platform encoding doesn't preserve Unicode.
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/CompareResultDialog.java
public class SimpleDamagerRepairer implements IPresentationDamager, IPresentationRepairer {
            private IDocument fDocument;
            public void setDocument(IDocument document) {
                fDocument= document;
            }
            public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent event, boolean changed) {
                return new Region(0, fDocument.getLength());
            }
            public void createPresentation(TextPresentation presentation, ITypedRegion damage) {
                int suffix= CompareResultDialog.fgThis.fSuffix;
                int prefix= CompareResultDialog.fgThis.fPrefix;
                TextAttribute attr= new TextAttribute(Display.getDefault().getSystemColor(SWT.COLOR_RED), null, SWT.BOLD);
                presentation.addStyleRange(new StyleRange(prefix, fDocument.getLength()-suffix-prefix, attr.getForeground(), attr.getBackground(), attr.getStyle()));
            }
        }
        
        public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
            PresentationReconciler reconciler= new PresentationReconciler();
            SimpleDamagerRepairer dr= new SimpleDamagerRepairer();
            reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
            reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
            return reconciler;
        }
    }
    
    private static class CharacterComparator implements ITokenComparator {