OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007, 2008, 2009 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const TextEncoding& closestByteBasedEquivalent() const; | 45 const TextEncoding& closestByteBasedEquivalent() const; |
46 const TextEncoding& encodingForFormSubmission() const; | 46 const TextEncoding& encodingForFormSubmission() const; |
47 | 47 |
48 String decode(const char* str, size_t length) const | 48 String decode(const char* str, size_t length) const |
49 { | 49 { |
50 bool ignored; | 50 bool ignored; |
51 return decode(str, length, false, ignored); | 51 return decode(str, length, false, ignored); |
52 } | 52 } |
53 String decode(const char*, size_t length, bool stopOnError, bool& sawError)
const; | 53 String decode(const char*, size_t length, bool stopOnError, bool& sawError)
const; |
54 | 54 |
55 // Encodes the string, but does *not* normalize first. | |
56 CString encode(const String&, UnencodableHandling) const; | 55 CString encode(const String&, UnencodableHandling) const; |
57 | 56 |
58 // Applies Unicode NFC normalization, then encodes the normalized string. | |
59 CString normalizeAndEncode(const String&, UnencodableHandling) const; | |
60 | |
61 private: | 57 private: |
62 bool isNonByteBasedEncoding() const; | 58 bool isNonByteBasedEncoding() const; |
63 bool isUTF7Encoding() const; | 59 bool isUTF7Encoding() const; |
64 | 60 |
65 const char* m_name; | 61 const char* m_name; |
66 }; | 62 }; |
67 | 63 |
68 inline bool operator==(const TextEncoding& a, const TextEncoding& b) { return a.
name() == b.name(); } | 64 inline bool operator==(const TextEncoding& a, const TextEncoding& b) { return a.
name() == b.name(); } |
69 inline bool operator!=(const TextEncoding& a, const TextEncoding& b) { return a.
name() != b.name(); } | 65 inline bool operator!=(const TextEncoding& a, const TextEncoding& b) { return a.
name() != b.name(); } |
70 | 66 |
(...skipping 11 matching lines...) Expand all Loading... |
82 using WTF::ASCIIEncoding; | 78 using WTF::ASCIIEncoding; |
83 using WTF::Latin1Encoding; | 79 using WTF::Latin1Encoding; |
84 using WTF::UTF16BigEndianEncoding; | 80 using WTF::UTF16BigEndianEncoding; |
85 using WTF::UTF16LittleEndianEncoding; | 81 using WTF::UTF16LittleEndianEncoding; |
86 using WTF::UTF32BigEndianEncoding; | 82 using WTF::UTF32BigEndianEncoding; |
87 using WTF::UTF32LittleEndianEncoding; | 83 using WTF::UTF32LittleEndianEncoding; |
88 using WTF::UTF8Encoding; | 84 using WTF::UTF8Encoding; |
89 using WTF::WindowsLatin1Encoding; | 85 using WTF::WindowsLatin1Encoding; |
90 | 86 |
91 #endif // TextEncoding_h | 87 #endif // TextEncoding_h |
OLD | NEW |