Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Maetzel2004-03-08 18:55:41 +0000
committerKai Maetzel2004-03-08 18:55:41 +0000
commit6cd5b5ffd09910a580d408987ae315ed672c1086 (patch)
tree7c16ef880432a4153841742b729046166f26ce5d /org.eclipse.core.filebuffers
parentecbcffd018e5782f4d15df0530e181d26eff2357 (diff)
downloadeclipse.platform.text-6cd5b5ffd09910a580d408987ae315ed672c1086.tar.gz
eclipse.platform.text-6cd5b5ffd09910a580d408987ae315ed672c1086.tar.xz
eclipse.platform.text-6cd5b5ffd09910a580d408987ae315ed672c1086.zip
unwind #54058
Diffstat (limited to 'org.eclipse.core.filebuffers')
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java22
1 files changed, 2 insertions, 20 deletions
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java
index 9a3535835..b18404c04 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java
@@ -111,7 +111,7 @@ public class ResourceTextFileBuffer extends ResourceFileBuffer implements ITextF
public void setEncoding(String encoding) {
fEncoding= encoding;
try {
- fFile.setCharset(encoding);
+ fFile.setPersistentProperty(ENCODING_KEY, encoding);
} catch (CoreException x) {
handleCoreException(x);
}
@@ -193,25 +193,7 @@ public class ResourceTextFileBuffer extends ResourceFileBuffer implements ITextF
*/
protected void initializeFileBufferContent(IProgressMonitor monitor) throws CoreException {
try {
- fEncoding= null;
- try {
- fEncoding= fFile.getPersistentProperty(ENCODING_KEY);
- } catch (CoreException x) {
- // we ignore exceptions here because we support the ENCODING_KEY property only for compatibility reasons
- }
- if (fEncoding != null) {
- // if we found an old encoding property, we try to migrate it to the new core.resources encoding support
- try {
- fFile.setCharset(fEncoding);
- // if successful delete old property
- fFile.setPersistentProperty(ENCODING_KEY, null);
- } catch (CoreException ex) {
- // log problem because we could not migrate the property successfully
- handleCoreException(ex);
- }
- } else {
- fEncoding= fFile.getCharset();
- }
+ fEncoding= fFile.getPersistentProperty(ENCODING_KEY);
fDocument= fManager.createEmptyDocument(fFile.getLocation());
setDocumentContent(fDocument, fFile.getContents(), fEncoding);
} catch (CoreException x) {

Back to the top