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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 if (converter) | 46 if (converter) |
47 ucnv_close(converter); | 47 ucnv_close(converter); |
48 } | 48 } |
49 | 49 |
50 static UConverter*& cachedConverterICU() { | 50 static UConverter*& cachedConverterICU() { |
51 return wtfThreadData().cachedConverterICU().converter; | 51 return wtfThreadData().cachedConverterICU().converter; |
52 } | 52 } |
53 | 53 |
54 std::unique_ptr<TextCodec> TextCodecICU::create(const TextEncoding& encoding, | 54 std::unique_ptr<TextCodec> TextCodecICU::create(const TextEncoding& encoding, |
55 const void*) { | 55 const void*) { |
56 return wrapUnique(new TextCodecICU(encoding)); | 56 return WTF::wrapUnique(new TextCodecICU(encoding)); |
57 } | 57 } |
58 | 58 |
59 void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar) { | 59 void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar) { |
60 // We register Hebrew with logical ordering using a separate name. | 60 // We register Hebrew with logical ordering using a separate name. |
61 // Otherwise, this would share the same canonical name as the | 61 // Otherwise, this would share the same canonical name as the |
62 // visual ordering case, and then TextEncoding could not tell them | 62 // visual ordering case, and then TextEncoding could not tell them |
63 // apart; ICU treats these names as synonyms. | 63 // apart; ICU treats these names as synonyms. |
64 registrar("ISO-8859-8-I", "ISO-8859-8-I"); | 64 registrar("ISO-8859-8-I", "ISO-8859-8-I"); |
65 | 65 |
66 int32_t numEncodings = ucnv_countAvailable(); | 66 int32_t numEncodings = ucnv_countAvailable(); |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 return encodeCommon(characters, length, handling); | 702 return encodeCommon(characters, length, handling); |
703 } | 703 } |
704 | 704 |
705 CString TextCodecICU::encode(const LChar* characters, | 705 CString TextCodecICU::encode(const LChar* characters, |
706 size_t length, | 706 size_t length, |
707 UnencodableHandling handling) { | 707 UnencodableHandling handling) { |
708 return encodeCommon(characters, length, handling); | 708 return encodeCommon(characters, length, handling); |
709 } | 709 } |
710 | 710 |
711 } // namespace WTF | 711 } // namespace WTF |
OLD | NEW |