OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> | 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 decodeToBuffer(buffer, bufferLimit, source, sourceLimit, offsets, tr
ue, err); | 365 decodeToBuffer(buffer, bufferLimit, source, sourceLimit, offsets, tr
ue, err); |
366 } while (source < sourceLimit); | 366 } while (source < sourceLimit); |
367 sawError = true; | 367 sawError = true; |
368 } | 368 } |
369 | 369 |
370 String resultString = result.toString(); | 370 String resultString = result.toString(); |
371 | 371 |
372 // <http://bugs.webkit.org/show_bug.cgi?id=17014> | 372 // <http://bugs.webkit.org/show_bug.cgi?id=17014> |
373 // Simplified Chinese pages use the code A3A0 to mean "full-width space", bu
t ICU decodes it as U+E5E5. | 373 // Simplified Chinese pages use the code A3A0 to mean "full-width space", bu
t ICU decodes it as U+E5E5. |
374 if (!strcmp(m_encoding.name(), "GBK") || !strcasecmp(m_encoding.name(), "gb1
8030")) | 374 if (!strcmp(m_encoding.name(), "GBK") || !strcasecmp(m_encoding.name(), "gb1
8030")) |
375 resultString.replace(0xE5E5, ideographicSpace); | 375 resultString.replace(0xE5E5, ideographicSpaceCharacter); |
376 | 376 |
377 return resultString; | 377 return resultString; |
378 } | 378 } |
379 | 379 |
380 // We need to apply these fallbacks ourselves as they are not currently supporte
d by ICU and | 380 // We need to apply these fallbacks ourselves as they are not currently supporte
d by ICU and |
381 // they were provided by the old TEC encoding path. Needed to fix <rdar://proble
m/4708689>. | 381 // they were provided by the old TEC encoding path. Needed to fix <rdar://proble
m/4708689>. |
382 static UChar fallbackForGBK(UChar32 character) | 382 static UChar fallbackForGBK(UChar32 character) |
383 { | 383 { |
384 switch (character) { | 384 switch (character) { |
385 case 0x01F9: | 385 case 0x01F9: |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 { | 538 { |
539 return encodeCommon(characters, length, handling); | 539 return encodeCommon(characters, length, handling); |
540 } | 540 } |
541 | 541 |
542 CString TextCodecICU::encode(const LChar* characters, size_t length, Unencodable
Handling handling) | 542 CString TextCodecICU::encode(const LChar* characters, size_t length, Unencodable
Handling handling) |
543 { | 543 { |
544 return encodeCommon(characters, length, handling); | 544 return encodeCommon(characters, length, handling); |
545 } | 545 } |
546 | 546 |
547 } // namespace WTF | 547 } // namespace WTF |
OLD | NEW |