Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / wtf / text / TextCodecICU.cpp
index f6f54e0..2c2ef23 100644 (file)
@@ -116,9 +116,7 @@ void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar)
             }
     }
 
-    // Additional aliases.
-    // These are present in modern versions of ICU, but not in ICU 3.2 (shipped with Mac OS X 10.4).
-    registrar("macroman", "macintosh");
+    // Additional alias for MacCyrillic not present in ICU.
     registrar("maccyrillic", "x-mac-cyrillic");
 
     // Additional aliases that historically were present in the encoding
@@ -156,11 +154,6 @@ void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar)
     registrar("x-uhc", "EUC-KR");
     registrar("shift-jis", "Shift_JIS");
 
-    // These aliases are present in modern versions of ICU, but use different codecs, and have no standard names.
-    // They are not present in ICU 3.2.
-    registrar("dos-720", "cp864");
-    registrar("jis7", "ISO-2022-JP");
-
     // Alternative spelling of ISO encoding names.
     registrar("ISO8859-1", "ISO-8859-1");
     registrar("ISO8859-2", "ISO-8859-2");
@@ -176,10 +169,10 @@ void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar)
     registrar("ISO8859-13", "ISO-8859-13");
     registrar("ISO8859-14", "ISO-8859-14");
     registrar("ISO8859-15", "ISO-8859-15");
-    // Not registering ISO8859-16, because Firefox (as of version 3.6.6) doesn't know this particular alias,
-    // and because older versions of ICU don't support ISO-8859-16 encoding at all.
+    // No need to have an entry for ISO8859-16. ISO-8859-16 has just one label
+    // listed in WHATWG Encoding Living Standard (http://encoding.spec.whatwg.org/ ).
 
-    // Additional aliases present in the WHATWG Encoding Standard (http://encoding.spec.whatwg.org/)
+    // Additional aliases present in the WHATWG Encoding Standard
     // and Firefox (24), but not in ICU 4.6.
     registrar("csiso58gb231280", "GBK");
     registrar("csiso88596e", "ISO-8859-6");
@@ -337,7 +330,7 @@ private:
     UConverterToUCallback m_savedAction;
 };
 
-String TextCodecICU::decode(const char* bytes, size_t length, bool flush, bool stopOnError, bool& sawError)
+String TextCodecICU::decode(const char* bytes, size_t length, FlushBehavior flush, bool stopOnError, bool& sawError)
 {
     // Get a converter for the passed-in encoding.
     if (!m_converterICU) {
@@ -361,7 +354,7 @@ String TextCodecICU::decode(const char* bytes, size_t length, bool flush, bool s
     UErrorCode err = U_ZERO_ERROR;
 
     do {
-        int ucharsDecoded = decodeToBuffer(buffer, bufferLimit, source, sourceLimit, offsets, flush, err);
+        int ucharsDecoded = decodeToBuffer(buffer, bufferLimit, source, sourceLimit, offsets, flush != DoNotFlush, err);
         result.append(buffer, ucharsDecoded);
     } while (err == U_BUFFER_OVERFLOW_ERROR);