]> granicus.if.org Git - icu/commitdiff
ICU-8970 MungeInput when neccessary on detection instead of when text is set
authorMichael Ow <mow@svn.icu-project.org>
Thu, 8 Dec 2011 17:04:46 +0000 (17:04 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Thu, 8 Dec 2011 17:04:46 +0000 (17:04 +0000)
X-SVN-Rev: 31065

icu4j/main/classes/core/src/com/ibm/icu/text/CharsetDetector.java

index 741b5f907263822bbdefbff913ffab7a37b8feb4..7fc8553f4308d30f7612cb132a998c54f8b7276b 100644 (file)
@@ -1,6 +1,6 @@
 /**
 *******************************************************************************
-* Copyright (C) 2005-2009, International Business Machines Corporation and    *
+* Copyright (C) 2005-2011, International Business Machines Corporation and    *
 * others. All Rights Reserved.                                                *
 *******************************************************************************
 */
@@ -88,8 +88,6 @@ public class CharsetDetector {
         fRawInput  = in;
         fRawLength = in.length;
         
-        MungeInput();
-        
         return this;
     }
     
@@ -130,7 +128,6 @@ public class CharsetDetector {
         }
         fInputStream.reset();
         
-        MungeInput();                     // Strip html markup, collect byte stats.
         return this;
     }
 
@@ -190,6 +187,8 @@ public class CharsetDetector {
         int               confidence;
         ArrayList<CharsetMatch>         matches = new ArrayList<CharsetMatch>();
         
+        MungeInput();  // Strip html markup, collect byte stats.
+        
         //  Iterate over all possible charsets, remember all that
         //    give a match quality > 0.
         for (i=0; i<fCSRecognizers.size(); i++) {