| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 const int nonCharacter1 = -1; | 41 const int nonCharacter1 = -1; |
| 42 const int nonCharacter2 = -2; | 42 const int nonCharacter2 = -2; |
| 43 const int nonCharacter3 = -3; | 43 const int nonCharacter3 = -3; |
| 44 | 44 |
| 45 bool isNonCharacter(int character) { | 45 bool isNonCharacter(int character) { |
| 46 return character >= nonCharacter3 && character <= nonCharacter1; | 46 return character >= nonCharacter3 && character <= nonCharacter1; |
| 47 } | 47 } |
| 48 | 48 |
| 49 std::unique_ptr<TextCodec> TextCodecUTF8::create(const TextEncoding&, | 49 std::unique_ptr<TextCodec> TextCodecUTF8::create(const TextEncoding&, |
| 50 const void*) { | 50 const void*) { |
| 51 return wrapUnique(new TextCodecUTF8); | 51 return WTF::wrapUnique(new TextCodecUTF8); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void TextCodecUTF8::registerEncodingNames(EncodingNameRegistrar registrar) { | 54 void TextCodecUTF8::registerEncodingNames(EncodingNameRegistrar registrar) { |
| 55 registrar("UTF-8", "UTF-8"); | 55 registrar("UTF-8", "UTF-8"); |
| 56 | 56 |
| 57 // Additional aliases that originally were present in the encoding | 57 // Additional aliases that originally were present in the encoding |
| 58 // table in WebKit on Macintosh, and subsequently added by | 58 // table in WebKit on Macintosh, and subsequently added by |
| 59 // TextCodecICU. Perhaps we can prove some are not used on the web | 59 // TextCodecICU. Perhaps we can prove some are not used on the web |
| 60 // and remove them. | 60 // and remove them. |
| 61 registrar("unicode11utf8", "UTF-8"); | 61 registrar("unicode11utf8", "UTF-8"); |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 return encodeCommon(characters, length); | 487 return encodeCommon(characters, length); |
| 488 } | 488 } |
| 489 | 489 |
| 490 CString TextCodecUTF8::encode(const LChar* characters, | 490 CString TextCodecUTF8::encode(const LChar* characters, |
| 491 size_t length, | 491 size_t length, |
| 492 UnencodableHandling) { | 492 UnencodableHandling) { |
| 493 return encodeCommon(characters, length); | 493 return encodeCommon(characters, length); |
| 494 } | 494 } |
| 495 | 495 |
| 496 } // namespace WTF | 496 } // namespace WTF |
| OLD | NEW |