Changeset 78451 in webkit
- Timestamp:
- Feb 13, 2011 7:28:37 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r78450 r78451 1 2011-02-12 Darin Adler <darin@apple.com> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Add built-in decoder for UTF-8 for improved performance 6 https://bugs.webkit.org/show_bug.cgi?id=53898 7 8 Covered by existing tests; not adding new tests at this time. 9 10 This patch now handles errors in the same way the existing codecs do, 11 and so passes our tests. The previous version failed some tests because 12 of incorrect error handling. 13 14 * platform/text/TextCodecICU.cpp: 15 (WebCore::create): Renamed from newTextCodecICU, made a static member 16 function, and added a call to adoptPtr. 17 (WebCore::TextCodecICU::registerEncodingNames): Renamed from 18 registerExtendedEncodingNames since this class is no longer used for 19 base codecs. Removed aliases for UTF-8; now handled by TextCodecUTF8. 20 (WebCore::TextCodecICU::registerCodecs): Renamed. 21 (WebCore::fallbackForGBK): Renamed to conform to our current style. 22 23 * platform/text/TextCodecICU.h: Updated for above changes. Changed 24 indentation. Made most functions private, including virtual function 25 overrides. Marked ICUConverterWrapper noncopyable. 26 27 * platform/text/TextCodecUTF8.cpp: 28 (WebCore::TextCodecUTF8::registerEncodingNames): Added the UTF-8 aliases 29 that were formerly added by TextCodecICU. 30 (WebCore::nonASCIISequenceLength): Fixed bug where this would return 4 for 31 bytes F5-FF instead of failing. 32 (WebCore::decodeNonASCIISequence): Tweaked coding style. 33 (WebCore::appendCharacter): Added. Makes it easier to share code between 34 the partial-character handling and main loop. 35 (WebCore::TextCodecUTF8::decode): Fixed buffer size computation for case 36 where there is a partial sequence. Fixed partial sequence handling so that 37 goto is no longer needed, since compilers sometimes make poor code when 38 goto is involved. Added a loop for partial sequences since we consume only 39 one byte when a partial sequence is invalid. Fixed logic in main decoding 40 loop so goto is not needed. Used early-exit style in both loops so the main 41 flow is not nested inside if statements. Added correct error handling for 42 flush when a partial sequence remains, which involved wrapping the function 43 in yet another loop. 44 45 * platform/text/TextCodecUTF8.h: Made virtual function overrides private. 46 47 * platform/text/TextEncodingRegistry.cpp: 48 (WebCore::buildBaseTextCodecMaps): Added calls to TextCodecUTF8. Removed 49 calls to TextCodecICU. Added FIXMEs for other codecs that no longer need 50 to be included here. 51 (WebCore::extendTextCodecMaps): Updated for the name change of the 52 TextCodecICU functions. 53 1 54 2011-02-13 Mark Rowe <mrowe@apple.com> 2 55 -
trunk/Source/WebCore/platform/text/TextCodecICU.cpp
r77849 r78451 1 1 /* 2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2004, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> 4 4 * … … 28 28 #include "TextCodecICU.h" 29 29 30 #include "PlatformString.h"31 30 #include "ThreadGlobalData.h" 32 31 #include <unicode/ucnv.h> 33 32 #include <unicode/ucnv_cb.h> 34 33 #include <wtf/Assertions.h> 35 #include <wtf/text/CString.h>36 #include <wtf/PassOwnPtr.h>37 34 #include <wtf/StringExtras.h> 38 35 #include <wtf/Threading.h> 36 #include <wtf/text/CString.h> 39 37 #include <wtf/unicode/CharacterNames.h> 40 38 … … 56 54 } 57 55 58 static PassOwnPtr<TextCodec> newTextCodecICU(const TextEncoding& encoding, const void*) 59 { 60 return new TextCodecICU(encoding); 61 } 62 63 void TextCodecICU::registerBaseEncodingNames(EncodingNameRegistrar registrar) 64 { 65 registrar("UTF-8", "UTF-8"); 66 } 67 68 void TextCodecICU::registerBaseCodecs(TextCodecRegistrar registrar) 69 { 70 registrar("UTF-8", newTextCodecICU, 0); 71 } 72 73 void TextCodecICU::registerExtendedEncodingNames(EncodingNameRegistrar registrar) 56 PassOwnPtr<TextCodec> TextCodecICU::create(const TextEncoding& encoding, const void*) 57 { 58 return adoptPtr(new TextCodecICU(encoding)); 59 } 60 61 void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar) 74 62 { 75 63 // We register Hebrew with logical ordering using a separate name. … … 144 132 registrar("koi", "KOI8-R"); 145 133 registrar("logical", "ISO-8859-8-I"); 146 registrar("unicode11utf8", "UTF-8");147 registrar("unicode20utf8", "UTF-8");148 registrar("x-unicode20utf8", "UTF-8");149 134 registrar("visual", "ISO-8859-8"); 150 135 registrar("winarabic", "windows-1256"); … … 164 149 registrar("x-windows-949", "windows-949"); 165 150 registrar("x-uhc", "windows-949"); 166 registrar("utf8", "UTF-8");167 151 registrar("shift-jis", "Shift_JIS"); 168 152 … … 191 175 } 192 176 193 void TextCodecICU::register ExtendedCodecs(TextCodecRegistrar registrar)177 void TextCodecICU::registerCodecs(TextCodecRegistrar registrar) 194 178 { 195 179 // See comment above in registerEncodingNames. 196 registrar("ISO-8859-8-I", newTextCodecICU, 0);180 registrar("ISO-8859-8-I", create, 0); 197 181 198 182 int32_t numEncodings = ucnv_countAvailable(); … … 207 191 continue; 208 192 } 209 registrar(standardName, newTextCodecICU, 0);193 registrar(standardName, create, 0); 210 194 } 211 195 } … … 301 285 } 302 286 } 287 303 288 private: 304 289 UConverter* m_converter; … … 355 340 356 341 // We need to apply these fallbacks ourselves as they are not currently supported by ICU and 357 // they were provided by the old TEC encoding path 358 // Needed to fix <rdar://problem/4708689> 359 static UChar getGbkEscape(UChar32 codePoint) 360 { 361 switch (codePoint) { 362 case 0x01F9: 363 return 0xE7C8; 364 case 0x1E3F: 365 return 0xE7C7; 366 case 0x22EF: 367 return 0x2026; 368 case 0x301C: 369 return 0xFF5E; 370 default: 371 return 0; 372 } 342 // they were provided by the old TEC encoding path. Needed to fix <rdar://problem/4708689>. 343 static UChar fallbackForGBK(UChar32 character) 344 { 345 switch (character) { 346 case 0x01F9: 347 return 0xE7C8; 348 case 0x1E3F: 349 return 0xE7C7; 350 case 0x22EF: 351 return 0x2026; 352 case 0x301C: 353 return 0xFF5E; 354 } 355 return 0; 373 356 } 374 357 … … 376 359 // characters. See the declaration of TextCodec::encode for more. 377 360 static void urlEscapedEntityCallback(const void* context, UConverterFromUnicodeArgs* fromUArgs, const UChar* codeUnits, int32_t length, 378 361 UChar32 codePoint, UConverterCallbackReason reason, UErrorCode* err) 379 362 { 380 363 if (reason == UCNV_UNASSIGNED) { … … 390 373 // Substitutes special GBK characters, escaping all other unassigned entities. 391 374 static void gbkCallbackEscape(const void* context, UConverterFromUnicodeArgs* fromUArgs, const UChar* codeUnits, int32_t length, 392 375 UChar32 codePoint, UConverterCallbackReason reason, UErrorCode* err) 393 376 { 394 377 UChar outChar; 395 if (reason == UCNV_UNASSIGNED && (outChar = getGbkEscape(codePoint))) {378 if (reason == UCNV_UNASSIGNED && (outChar = fallbackForGBK(codePoint))) { 396 379 const UChar* source = &outChar; 397 380 *err = U_ZERO_ERROR; … … 404 387 // Combines both gbkUrlEscapedEntityCallback and GBK character substitution. 405 388 static void gbkUrlEscapedEntityCallack(const void* context, UConverterFromUnicodeArgs* fromUArgs, const UChar* codeUnits, int32_t length, 406 389 UChar32 codePoint, UConverterCallbackReason reason, UErrorCode* err) 407 390 { 408 391 if (reason == UCNV_UNASSIGNED) { 409 if (UChar outChar = getGbkEscape(codePoint)) {392 if (UChar outChar = fallbackForGBK(codePoint)) { 410 393 const UChar* source = &outChar; 411 394 *err = U_ZERO_ERROR; … … 420 403 421 404 static void gbkCallbackSubstitute(const void* context, UConverterFromUnicodeArgs* fromUArgs, const UChar* codeUnits, int32_t length, 422 405 UChar32 codePoint, UConverterCallbackReason reason, UErrorCode* err) 423 406 { 424 407 UChar outChar; 425 if (reason == UCNV_UNASSIGNED && (outChar = getGbkEscape(codePoint))) {408 if (reason == UCNV_UNASSIGNED && (outChar = fallbackForGBK(codePoint))) { 426 409 const UChar* source = &outChar; 427 410 *err = U_ZERO_ERROR; … … 487 470 } 488 471 489 490 472 } // namespace WebCore -
trunk/Source/WebCore/platform/text/TextCodecICU.h
r77831 r78451 1 1 /* 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2004, 2006, 2007, 2011 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> 4 4 * … … 30 30 #include "TextCodec.h" 31 31 #include "TextEncoding.h" 32 33 32 #include <unicode/utypes.h> 34 33 … … 39 38 class TextCodecICU : public TextCodec { 40 39 public: 41 static void register BaseEncodingNames(EncodingNameRegistrar);42 static void register BaseCodecs(TextCodecRegistrar);40 static void registerEncodingNames(EncodingNameRegistrar); 41 static void registerCodecs(TextCodecRegistrar); 43 42 44 static void registerExtendedEncodingNames(EncodingNameRegistrar); 45 static void registerExtendedCodecs(TextCodecRegistrar); 43 virtual ~TextCodecICU(); 46 44 45 private: 47 46 TextCodecICU(const TextEncoding&); 48 virtual ~TextCodecICU();47 static PassOwnPtr<TextCodec> create(const TextEncoding&, const void*); 49 48 50 49 virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError); 51 50 virtual CString encode(const UChar*, size_t length, UnencodableHandling); 52 51 53 private:54 52 void createICUConverter() const; 55 53 void releaseICUConverter() const; … … 68 66 69 67 struct ICUConverterWrapper { 70 ICUConverterWrapper() 71 : converter(0) 72 { 73 } 68 ICUConverterWrapper() : converter(0) { } 74 69 ~ICUConverterWrapper(); 75 70 76 71 UConverter* converter; 72 73 WTF_MAKE_NONCOPYABLE(ICUConverterWrapper); 77 74 }; 78 75 -
trunk/Source/WebCore/platform/text/TextCodecUTF8.cpp
r77819 r78451 29 29 #include <wtf/text/CString.h> 30 30 #include <wtf/text/StringBuffer.h> 31 #include <wtf/unicode/ UTF8.h>31 #include <wtf/unicode/CharacterNames.h> 32 32 33 33 using namespace WTF::Unicode; … … 35 35 36 36 namespace WebCore { 37 38 const int nonCharacter = -1; 37 39 38 40 // Assuming that a pointer is the size of a "machine word", then … … 94 96 { 95 97 registrar("UTF-8", "UTF-8"); 98 99 // Additional aliases that originally were present in the encoding 100 // table in WebKit on Macintosh, and subsequently added by 101 // TextCodecICU. Perhaps we can prove some are not used on the web 102 // and remove them. 103 registrar("unicode11utf8", "UTF-8"); 104 registrar("unicode20utf8", "UTF-8"); 105 registrar("utf8", "UTF-8"); 106 registrar("x-unicode20utf8", "UTF-8"); 96 107 } 97 108 … … 101 112 } 102 113 103 static inline int nonASCIISequenceLength(unsigned char firstByte) 104 { 105 ASSERT(!isASCII(firstByte)); 106 switch (firstByte >> 4) { 107 case 0xF: 108 return 4; 109 case 0xE: 110 return 3; 111 } 112 return 2; 113 } 114 115 static inline int decodeNonASCIISequence(const unsigned char* sequence, unsigned length) 114 static inline int nonASCIISequenceLength(uint8_t firstByte) 115 { 116 static const uint8_t lengths[256] = { 117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 126 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 127 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 128 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 129 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 130 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 131 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 132 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 133 }; 134 return lengths[firstByte]; 135 } 136 137 static inline int decodeNonASCIISequence(const uint8_t* sequence, unsigned length) 116 138 { 117 139 ASSERT(!isASCII(sequence[0])); … … 119 141 ASSERT(sequence[0] <= 0xDF); 120 142 if (sequence[0] < 0xC2) 121 return -1;143 return nonCharacter; 122 144 if (sequence[1] < 0x80 || sequence[1] > 0xBF) 123 return -1;145 return nonCharacter; 124 146 return ((sequence[0] << 6) + sequence[1]) - 0x00003080; 125 147 } … … 129 151 case 0xE0: 130 152 if (sequence[1] < 0xA0 || sequence[1] > 0xBF) 131 return -1;153 return nonCharacter; 132 154 break; 133 155 case 0xED: 134 156 if (sequence[1] < 0x80 || sequence[1] > 0x9F) 135 return -1;157 return nonCharacter; 136 158 break; 137 159 default: 138 160 if (sequence[1] < 0x80 || sequence[1] > 0xBF) 139 return -1;161 return nonCharacter; 140 162 } 141 163 if (sequence[2] < 0x80 || sequence[2] > 0xBF) 142 return -1;164 return nonCharacter; 143 165 return ((sequence[0] << 12) + (sequence[1] << 6) + sequence[2]) - 0x000E2080; 144 166 } … … 148 170 case 0xF0: 149 171 if (sequence[1] < 0x90 || sequence[1] > 0xBF) 150 return -1;172 return nonCharacter; 151 173 break; 152 174 case 0xF4: 153 175 if (sequence[1] < 0x80 || sequence[1] > 0x8F) 154 return -1;176 return nonCharacter; 155 177 break; 156 178 default: 157 179 if (sequence[1] < 0x80 || sequence[1] > 0xBF) 158 return -1;180 return nonCharacter; 159 181 } 160 182 if (sequence[2] < 0x80 || sequence[2] > 0xBF) 161 return -1;183 return nonCharacter; 162 184 if (sequence[3] < 0x80 || sequence[3] > 0xBF) 163 return -1;185 return nonCharacter; 164 186 return ((sequence[0] << 18) + (sequence[1] << 12) + (sequence[2] << 6) + sequence[3]) - 0x03C82080; 165 187 } 166 188 189 static inline UChar* appendCharacter(UChar* destination, int character) 190 { 191 ASSERT(character != nonCharacter); 192 ASSERT(!U_IS_SURROGATE(character)); 193 if (U_IS_BMP(character)) 194 *destination++ = character; 195 else { 196 *destination++ = U16_LEAD(character); 197 *destination++ = U16_TRAIL(character); 198 } 199 return destination; 200 } 201 167 202 String TextCodecUTF8::decode(const char* bytes, size_t length, bool flush, bool stopOnError, bool& sawError) 168 203 { 169 StringBuffer buffer(length); 204 // Each input byte might turn into a character. 205 // That includes all bytes in the partial-sequence buffer because 206 // each byte in an invalid sequence will turn into a replacement character. 207 StringBuffer buffer(m_partialSequenceSize + length); 170 208 171 209 const uint8_t* source = reinterpret_cast<const uint8_t*>(bytes); … … 174 212 UChar* destination = buffer.characters(); 175 213 176 int count; 177 int character; 178 179 if (m_partialSequenceSize) { 180 count = nonASCIISequenceLength(m_partialSequence[0]); 181 ASSERT(count > m_partialSequenceSize); 182 if (count - m_partialSequenceSize > end - source) { 183 memcpy(m_partialSequence + m_partialSequenceSize, source, end - source); 184 m_partialSequenceSize += end - source; 185 source = end; 186 } else { 214 do { 215 while (m_partialSequenceSize) { 216 int count = nonASCIISequenceLength(m_partialSequence[0]); 217 ASSERT(count > m_partialSequenceSize); 218 ASSERT(count >= 2); 219 ASSERT(count <= 4); 220 if (count - m_partialSequenceSize > end - source) { 221 if (!flush) { 222 // We have an incomplete partial sequence, so put it all in the partial 223 // sequence buffer, and break out of this loop so we can exit the function. 224 memcpy(m_partialSequence + m_partialSequenceSize, source, end - source); 225 m_partialSequenceSize += end - source; 226 source = end; 227 break; 228 } 229 // We have an incomplete partial sequence at the end of the buffer. 230 // That is an error. 231 sawError = true; 232 if (stopOnError) { 233 source = end; 234 break; 235 } 236 // Each error consumes one byte and generates one replacement character. 237 --m_partialSequenceSize; 238 memmove(m_partialSequence, m_partialSequence + 1, m_partialSequenceSize); 239 *destination++ = replacementCharacter; 240 continue; 241 } 187 242 uint8_t completeSequence[U8_MAX_LENGTH]; 188 243 memcpy(completeSequence, m_partialSequence, m_partialSequenceSize); 189 244 memcpy(completeSequence + m_partialSequenceSize, source, count - m_partialSequenceSize); 190 245 source += count - m_partialSequenceSize; 246 int character = decodeNonASCIISequence(completeSequence, count); 247 if (character == nonCharacter) { 248 sawError = true; 249 if (stopOnError) { 250 source = end; 251 break; 252 } 253 // Each error consumes one byte and generates one replacement character. 254 memcpy(m_partialSequence, completeSequence + 1, count - 1); 255 m_partialSequenceSize = count - 1; 256 *destination++ = replacementCharacter; 257 continue; 258 } 191 259 m_partialSequenceSize = 0; 192 character = decodeNonASCIISequence(completeSequence, count); 193 goto decodedNonASCII; 260 destination = appendCharacter(destination, character); 194 261 } 195 } 196 197 while (source < end) { 198 if (isASCII(*source)) { 199 // Fast path for ASCII. Most UTF-8 text will be ASCII. 200 if (isAlignedToMachineWord(source)) { 201 while (source < alignedEnd) { 202 MachineWord chunk = *reinterpret_cast_ptr<const MachineWord*>(source); 203 if (chunk & NonASCIIMask<sizeof(MachineWord)>::value()) { 204 if (isASCII(*source)) 262 263 while (source < end) { 264 if (isASCII(*source)) { 265 // Fast path for ASCII. Most UTF-8 text will be ASCII. 266 if (isAlignedToMachineWord(source)) { 267 while (source < alignedEnd) { 268 MachineWord chunk = *reinterpret_cast_ptr<const MachineWord*>(source); 269 if (chunk & NonASCIIMask<sizeof(MachineWord)>::value()) 205 270 break; 206 goto nonASCII; 271 UCharByteFiller<sizeof(MachineWord)>::copy(destination, source); 272 source += sizeof(MachineWord); 273 destination += sizeof(MachineWord); 207 274 } 208 UCharByteFiller<sizeof(MachineWord)>::copy(destination, source); 209 source += sizeof(MachineWord); 210 destination += sizeof(MachineWord); 211 } 212 if (source == end) 213 break; 214 } 215 *destination++ = *source++; 216 } else { 217 nonASCII: 218 count = nonASCIISequenceLength(*source); 219 ASSERT(count >= 2); 220 ASSERT(count <= 4); 221 if (count > end - source) { 222 ASSERT(end - source <= static_cast<ptrdiff_t>(sizeof(m_partialSequence))); 223 ASSERT(!m_partialSequenceSize); 224 m_partialSequenceSize = end - source; 225 memcpy(m_partialSequence, source, m_partialSequenceSize); 226 break; 227 } 228 character = decodeNonASCIISequence(source, count); 275 if (source == end) 276 break; 277 if (!isASCII(*source)) 278 continue; 279 } 280 *destination++ = *source++; 281 continue; 282 } 283 int count = nonASCIISequenceLength(*source); 284 int character; 285 if (!count) 286 character = nonCharacter; 287 else { 288 ASSERT(count >= 2); 289 ASSERT(count <= 4); 290 if (count > end - source) { 291 ASSERT(end - source <= static_cast<ptrdiff_t>(sizeof(m_partialSequence))); 292 ASSERT(!m_partialSequenceSize); 293 m_partialSequenceSize = end - source; 294 memcpy(m_partialSequence, source, m_partialSequenceSize); 295 break; 296 } 297 character = decodeNonASCIISequence(source, count); 298 } 299 if (character == nonCharacter) { 300 sawError = true; 301 if (stopOnError) 302 break; 303 // Each error consumes one byte and generates one replacement character. 304 ++source; 305 *destination++ = replacementCharacter; 306 continue; 307 } 229 308 source += count; 230 decodedNonASCII: 231 if (character < 0) { 232 if (stopOnError) { 233 sawError = true; 234 break; 235 } 236 } else { 237 ASSERT(!U_IS_SURROGATE(character)); 238 if (U_IS_BMP(character)) 239 *destination++ = character; 240 else { 241 *destination++ = U16_LEAD(character); 242 *destination++ = U16_TRAIL(character); 243 } 244 } 309 destination = appendCharacter(destination, character); 245 310 } 246 } 311 } while (flush && m_partialSequenceSize); 247 312 248 313 buffer.shrink(destination - buffer.characters()); 249 250 if (flush && m_partialSequenceSize)251 sawError = true;252 314 253 315 return String::adopt(buffer); -
trunk/Source/WebCore/platform/text/TextCodecUTF8.h
r77819 r78451 36 36 static void registerCodecs(TextCodecRegistrar); 37 37 38 virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError);39 virtual CString encode(const UChar*, size_t length, UnencodableHandling);40 41 38 private: 42 39 static PassOwnPtr<TextCodec> create(const TextEncoding&, const void*); 43 40 TextCodecUTF8() : m_partialSequenceSize(0) { } 41 42 virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError); 43 virtual CString encode(const UChar*, size_t length, UnencodableHandling); 44 44 45 45 int m_partialSequenceSize; -
trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp
r77831 r78451 59 59 #endif 60 60 61 #include <wtf/CurrentTime.h> 62 #include <wtf/text/CString.h> 63 61 64 using namespace WTF; 62 65 … … 221 224 TextCodecLatin1::registerCodecs(addToTextCodecMap); 222 225 226 TextCodecUTF8::registerEncodingNames(addToTextEncodingNameMap); 227 TextCodecUTF8::registerCodecs(addToTextCodecMap); 228 223 229 TextCodecUTF16::registerEncodingNames(addToTextEncodingNameMap); 224 230 TextCodecUTF16::registerCodecs(addToTextCodecMap); … … 227 233 TextCodecUserDefined::registerCodecs(addToTextCodecMap); 228 234 229 #if USE(ICU_UNICODE)230 TextCodecICU::registerBaseEncodingNames(addToTextEncodingNameMap);231 TextCodecICU::registerBaseCodecs(addToTextCodecMap);232 #endif233 234 235 #if USE(GLIB_UNICODE) 236 // FIXME: This is not needed. The code above covers all the base codecs. 235 237 TextCodecGtk::registerBaseEncodingNames(addToTextEncodingNameMap); 236 238 TextCodecGtk::registerBaseCodecs(addToTextCodecMap); … … 238 240 239 241 #if USE(BREWMP_UNICODE) 242 // FIXME: This is not needed. The code above covers all the base codecs. 240 243 TextCodecBrew::registerBaseEncodingNames(addToTextEncodingNameMap); 241 244 TextCodecBrew::registerBaseCodecs(addToTextCodecMap); … … 243 246 244 247 #if OS(WINCE) && !PLATFORM(QT) 248 // FIXME: This is not needed. The code above covers all the base codecs. 245 249 TextCodecWinCE::registerBaseEncodingNames(addToTextEncodingNameMap); 246 250 TextCodecWinCE::registerBaseCodecs(addToTextCodecMap); … … 304 308 { 305 309 #if USE(ICU_UNICODE) 306 TextCodecICU::registerE xtendedEncodingNames(addToTextEncodingNameMap);307 TextCodecICU::register ExtendedCodecs(addToTextCodecMap);310 TextCodecICU::registerEncodingNames(addToTextEncodingNameMap); 311 TextCodecICU::registerCodecs(addToTextCodecMap); 308 312 #endif 309 313
Note: See TracChangeset
for help on using the changeset viewer.