Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2004-05-28 09:35:25 +0000
committerDani Megert2004-05-28 09:35:25 +0000
commit028674d701a4431dfe422a6bc4461bb4f0236a9f (patch)
treedcfaaca5a4d5142fc8220861e18a57cc9a485527 /org.eclipse.core.filebuffers
parent337eed18fd7bc08761e3c377995d9edcb53396c1 (diff)
downloadeclipse.platform.text-028674d701a4431dfe422a6bc4461bb4f0236a9f.tar.gz
eclipse.platform.text-028674d701a4431dfe422a6bc4461bb4f0236a9f.tar.xz
eclipse.platform.text-028674d701a4431dfe422a6bc4461bb4f0236a9f.zip
Bug fix
Diffstat (limited to 'org.eclipse.core.filebuffers')
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java9
1 files changed, 5 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 6fcdc412e..5a1504779 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
@@ -263,10 +263,11 @@ public class JavaTextFileBuffer extends JavaFileBuffer implements ITextFileBuffe
IContentDescription description= Platform.getContentTypeManager().getDescriptionFor(stream, fFile.getName(), options);
if (description != null) {
fEncoding= description.getCharset();
-
- fUTF8BOM= (byte[]) description.getProperty(IContentDescription.BYTE_ORDER_MARK);
- if (fUTF8BOM != null && fUTF8BOM != IContentDescription.BOM_UTF_8)
- throw new CoreException(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getString("FileBuffer.error.wrongByteOrderMark"), null)); //$NON-NLS-1$
+ if (CHARSET_UTF_8.equals(fEncoding)) {
+ fUTF8BOM= (byte[]) description.getProperty(IContentDescription.BYTE_ORDER_MARK);
+ if (fUTF8BOM != null && fUTF8BOM != IContentDescription.BOM_UTF_8)
+ throw new CoreException(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getString("FileBuffer.error.wrongByteOrderMark"), null)); //$NON-NLS-1$
+ }
}
} catch (IOException e) {
fEncoding= null;

Back to the top