summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-04-07 21:44:46 (EDT)
committerpelder2006-04-07 21:44:46 (EDT)
commit558dbe712a0bd76f642422fe8124f126ecbac342 (patch)
tree31cd5f563fc86f4e34ed734f82ba1a348ef0a227
parentb7d35798cea349b20e750ee89662c758cc9c648f (diff)
downloadorg.eclipse.jet-558dbe712a0bd76f642422fe8124f126ecbac342.zip
org.eclipse.jet-558dbe712a0bd76f642422fe8124f126ecbac342.tar.gz
org.eclipse.jet-558dbe712a0bd76f642422fe8124f126ecbac342.tar.bz2
[134583] Turns out that not all UTF-8 encoded files need BOMs. MANIFEST.MF is one. Happily, the platform lets use know.
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java
index 3284a93..c94f8ba 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/workspace/ActionsUtil.java
@@ -152,7 +152,10 @@ public final class ActionsUtil
// work around SUN bug with UTF-8 encoding and byte-order marks.
// See: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
- if("UTF-8".equals(file.getCharset())) { //$NON-NLS-1$
+ boolean hasBOM = false;
+ IContentDescription description = file.getContentDescription();
+ hasBOM = description != null && description.getProperty(IContentDescription.BYTE_ORDER_MARK) != null;
+ if(hasBOM && "UTF-8".equals(file.getCharset())) { //$NON-NLS-1$
source = new SequenceInputStream(new ByteArrayInputStream(IContentDescription.BOM_UTF_8), source);
}
monitor.worked(1);