### Eclipse Workspace Patch 1.0
#P org.eclipse.wst.html.core
Index: META-INF/MANIFEST.MF
===================================================================
RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.html.core/META-INF/MANIFEST.MF,v
retrieving revision 1.33.2.2
diff -u -r1.33.2.2 MANIFEST.MF
--- META-INF/MANIFEST.MF	4 Jan 2012 23:18:59 -0000	1.33.2.2
+++ META-INF/MANIFEST.MF	26 Nov 2012 07:20:27 -0000
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.html.core; singleton:=true
-Bundle-Version: 1.1.502.qualifier
+Bundle-Version: 1.1.502.v201202091936-20121126
 Bundle-Activator: org.eclipse.wst.html.core.internal.HTMLCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -27,7 +27,8 @@
  org.eclipse.wst.html.core.internal.text;x-internal:=true,
  org.eclipse.wst.html.core.internal.validate;x-internal:=true,
  org.eclipse.wst.html.core.text
-Import-Package: com.ibm.icu.util; version="3.8"
+Import-Package: com.ibm.icu.util; version="3.8",
+ org.mozilla.universalchardet
 Require-Bundle: org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
  org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
  org.eclipse.wst.css.core;bundle-version="[1.1.400,1.2.0)",
Index: src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java
===================================================================
RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java,v
retrieving revision 1.3
diff -u -r1.3 EncodingGuesser.java
--- src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java	2 Mar 2011 15:24:16 -0000	1.3
+++ src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java	26 Nov 2012 07:20:28 -0000
@@ -12,6 +12,8 @@
  *******************************************************************************/
 package org.eclipse.wst.html.core.internal.contenttype;
 
+import org.mozilla.universalchardet.UniversalDetector;
+
 /**
  * 
  * This is ported from PageDesigner's hpbcom/Kanji.cpp's
@@ -109,10 +111,29 @@
 	 * length of target
 	 */
 	public static String guessEncoding(byte[] target, int length) {
+		if (System
+				.getProperty("org.eclipse.wst.html.core.disableGuessEncoding") != null) {
+			return null;
+		}
+		boolean avoidBUG = true;
+
 		int code = UNKNOWN;
 
-		
 		if (canGuess()) {
+			if (avoidBUG) {
+				while (length > 0) {
+					if (target[--length] != -1) {
+						length++;
+						break;
+					}
+				}
+				UniversalDetector detector = new UniversalDetector(null);
+				detector.handleData(target, 0, length);
+				detector.dataEnd();
+				String charset = detector.getDetectedCharset();
+				detector.reset();
+				return charset;
+			}
 			// Ok, I'm under ja_JP.
 			code = ASCII;
 			int pos = 0;
