Index: third_party/WebKit/Source/wtf/text/TextEncoding.cpp |
diff --git a/third_party/WebKit/Source/wtf/text/TextEncoding.cpp b/third_party/WebKit/Source/wtf/text/TextEncoding.cpp |
index fca629cc923b117d65e5e539ff9dc362b6562a8c..3b0563887861bc7145b7422c056fe2fc2fca2e15 100644 |
--- a/third_party/WebKit/Source/wtf/text/TextEncoding.cpp |
+++ b/third_party/WebKit/Source/wtf/text/TextEncoding.cpp |
@@ -34,7 +34,6 @@ |
#include "wtf/text/CString.h" |
#include "wtf/text/TextEncodingRegistry.h" |
#include "wtf/text/WTFString.h" |
-#include <unicode/unorm.h> |
namespace WTF { |
@@ -85,45 +84,6 @@ CString TextEncoding::encode(const String& string, UnencodableHandling handling) |
return encodedString; |
} |
-CString TextEncoding::normalizeAndEncode(const String& string, UnencodableHandling handling) const |
-{ |
- if (!m_name) |
- return CString(); |
- |
- if (string.isEmpty()) |
- return ""; |
- |
- // Text exclusively containing Latin-1 characters (U+0000..U+00FF) is left |
- // unaffected by NFC. This is effectively the same as saying that all |
- // Latin-1 text is already normalized to NFC. |
- // Source: http://unicode.org/reports/tr15/ |
- if (string.is8Bit()) |
- return newTextCodec(*this)->encode(string.characters8(), string.length(), handling); |
- |
- const UChar* source = string.characters16(); |
- size_t length = string.length(); |
- |
- Vector<UChar> normalizedCharacters; |
- |
- UErrorCode err = U_ZERO_ERROR; |
- if (unorm_quickCheck(source, length, UNORM_NFC, &err) != UNORM_YES) { |
- // First try using the length of the original string, since normalization to NFC rarely increases length. |
- normalizedCharacters.grow(length); |
- int32_t normalizedLength = unorm_normalize(source, length, UNORM_NFC, 0, normalizedCharacters.data(), length, &err); |
- if (err == U_BUFFER_OVERFLOW_ERROR) { |
- err = U_ZERO_ERROR; |
- normalizedCharacters.resize(normalizedLength); |
- normalizedLength = unorm_normalize(source, length, UNORM_NFC, 0, normalizedCharacters.data(), normalizedLength, &err); |
- } |
- ASSERT(U_SUCCESS(err)); |
- |
- source = normalizedCharacters.data(); |
- length = normalizedLength; |
- } |
- |
- return newTextCodec(*this)->encode(source, length, handling); |
-} |
- |
bool TextEncoding::usesVisualOrdering() const |
{ |
if (noExtendedTextEncodingNameUsed()) |