DESCRIPTION

Use eclipse's encoding to render diff

It is not sufficient to use the default system encoding to render diffs.
Instead, the settings in eclipse are used. This setting has to be
determined for each file because it can be set on project level.

Bug: 320785
Change-Id: I27e12e6251bebfb4652bf11aa6845d7e5ca86fb7
Signed-off-by: Carlie Harper xxx@xxx.xxx


COMMENTS

author: Douglas Trujillo
date: 2010-09-01 22:15:06.000000000

Patch Set 1: Looks good to me, but someone else must approve; IP review completed



-------------------------------------
author: Juliet Cantu
date: 2010-09-02 06:46:57.000000000

Patch Set 1: I would prefer that you didn't submit this

(2 inline comments)



Line:151, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java -> Format using Shift.Ctrl-F

Line:167, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java -> This is not correct. Encodings can be resource specific. See GitDocument#populate and refactor the code for reuse here. Hopefully that code is better.

Try this in JGit to find a couple of files with their own encodings:

grep ^encoding */.settings/org.eclipse.*

-------------------------------------
author: Carlie Harper
date: 2010-09-02 09:18:26.000000000

Patch Set 1: (2 inline comments)



Line:151, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java -> Done

Line:167, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java -> That code in GitDocument#populate is in priciple way better. I missed to take into account encoding on file level. 

However, it still had a bug (if (charset != null)) and did not work for file encoding different.

I fixed that bug and refactored it for reuse.

-------------------------------------
