View | Details | Raw Unified | Return to bug 323290 | Differences between
and this patch

Collapse All | Expand All

(-)compare/org/eclipse/compare/internal/patch/Utilities.java (+7 lines)
Lines 67-72 Link Here
67
				}
67
				}
68
				return true;
68
				return true;
69
			}
69
			}
70
            public String getCharset() throws CoreException {
71
                if (storage instanceof IEncodedStorage) {
72
                    IEncodedStorage es = (IEncodedStorage) storage;
73
                    return es.getCharset();
74
                }
75
                return super.getCharset();
76
            }
70
		};
77
		};
71
	}
78
	}
72
79
(-)src/org/eclipse/compare/internal/core/patch/FileDiffResult.java (-1 / +7 lines)
Lines 25-30 Link Here
25
import org.eclipse.compare.patch.IHunk;
25
import org.eclipse.compare.patch.IHunk;
26
import org.eclipse.compare.patch.PatchConfiguration;
26
import org.eclipse.compare.patch.PatchConfiguration;
27
import org.eclipse.compare.patch.ReaderCreator;
27
import org.eclipse.compare.patch.ReaderCreator;
28
import org.eclipse.core.runtime.CoreException;
28
import org.eclipse.core.runtime.IPath;
29
import org.eclipse.core.runtime.IPath;
29
import org.eclipse.core.runtime.IProgressMonitor;
30
import org.eclipse.core.runtime.IProgressMonitor;
30
import org.eclipse.core.runtime.NullProgressMonitor;
31
import org.eclipse.core.runtime.NullProgressMonitor;
Lines 70-76 Link Here
70
		this.fMatches= false;
71
		this.fMatches= false;
71
		this.fDiffProblem= false;
72
		this.fDiffProblem= false;
72
		boolean create= false;
73
		boolean create= false;
73
		this.charset = Utilities.getCharset(content);
74
		try {
75
			this.charset = content.getCharset();
76
		} catch (CoreException e) {
77
			// Log and continue
78
			ComparePlugin.log(e);
79
		}
74
		//If this diff is an addition, make sure that it doesn't already exist
80
		//If this diff is an addition, make sure that it doesn't already exist
75
		boolean exists = targetExists(content);
81
		boolean exists = targetExists(content);
76
		if (this.fDiff.getDiffType(getConfiguration().isReversed()) == FilePatch2.ADDITION) {
82
		if (this.fDiff.getDiffType(getConfiguration().isReversed()) == FilePatch2.ADDITION) {
(-)src/org/eclipse/compare/patch/ReaderCreator.java (+11 lines)
Lines 39-42 Link Here
39
	public boolean canCreateReader() {
39
	public boolean canCreateReader() {
40
		return true;
40
		return true;
41
	}
41
	}
42
43
	/**
44
	 * Return the charset of the underlying data or <code>null</code> if the
45
	 * charset could not be determined.
46
	 * @return the charset of the underlying data or <code>null</code>
47
	 * @throws CoreException
48
	 */
49
	public String getCharset() throws CoreException {
50
		return null;
51
	}
52
	
42
}
53
}

Return to bug 323290