Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2004-05-27 19:19:48 +0000
committerDani Megert2004-05-27 19:19:48 +0000
commit8d2ec104a5ec531ea4b0e0ead6f5e1626a8e75a3 (patch)
tree8e4377ca49e9af74a5802a96e6284d918a838a64 /org.eclipse.core.filebuffers
parentad77635f17f81adf10f69cc02529cf131882bc4c (diff)
downloadeclipse.platform.text-8d2ec104a5ec531ea4b0e0ead6f5e1626a8e75a3.tar.gz
eclipse.platform.text-8d2ec104a5ec531ea4b0e0ead6f5e1626a8e75a3.tar.xz
eclipse.platform.text-8d2ec104a5ec531ea4b0e0ead6f5e1626a8e75a3.zip
Bug fixing
Diffstat (limited to 'org.eclipse.core.filebuffers')
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java7
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java7
2 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java
index 4a5415e00..6fcdc412e 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java
@@ -357,8 +357,7 @@ public class JavaTextFileBuffer extends JavaFileBuffer implements ITextFileBuffe
String encoding= description.getCharset();
if (encoding != null)
return encoding;
- } else if (fUTF8BOM != null)
- return CHARSET_UTF_8;
+ }
} catch (IOException ex) {
// try next strategy
} finally {
@@ -369,6 +368,10 @@ public class JavaTextFileBuffer extends JavaFileBuffer implements ITextFileBuffe
}
}
+ // Use UTF-8 BOM if there was any
+ if (fUTF8BOM != null)
+ return CHARSET_UTF_8;
+
// Use global default
return fManager.getDefaultEncoding();
}
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 9c0caf86a..fdf2aee4a 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
@@ -397,8 +397,7 @@ public class ResourceTextFileBuffer extends ResourceFileBuffer implements ITextF
String encoding= description.getCharset();
if (encoding != null)
return encoding;
- } else if (fUTF8BOM != null)
- return CHARSET_UTF_8;
+ }
} catch (IOException ex) {
// try next strategy
} finally {
@@ -409,6 +408,10 @@ public class ResourceTextFileBuffer extends ResourceFileBuffer implements ITextF
}
}
+ // Use UTF-8 BOM if there was any
+ if (fUTF8BOM != null)
+ return CHARSET_UTF_8;
+
// Use parent chain
try {
return fFile.getParent().getDefaultCharset();

Back to the top