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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. | 55 // Encodes the string, but does *not* normalize first. |
56 CString encode(const String&, UnencodableHandling) const; | 56 CString encode(const String&, UnencodableHandling) const; |
57 | 57 |
58 // Applies Unicode NFC normalization, then encodes the normalized string. | 58 // Applies Unicode NFC normalization, then encodes the normalized string. |
59 CString normalizeAndEncode(const String&, UnencodableHandling) const; | 59 CString normalizeAndEncode(const String&, UnencodableHandling) const; |
60 | 60 |
61 UChar backslashAsCurrencySymbol() const; | |
62 | |
63 private: | 61 private: |
64 bool isNonByteBasedEncoding() const; | 62 bool isNonByteBasedEncoding() const; |
65 bool isUTF7Encoding() const; | 63 bool isUTF7Encoding() const; |
66 | 64 |
67 const char* m_name; | 65 const char* m_name; |
68 UChar m_backslashAsCurrencySymbol; | |
69 }; | 66 }; |
70 | 67 |
71 inline bool operator==(const TextEncoding& a, const TextEncoding& b) { return a.
name() == b.name(); } | 68 inline bool operator==(const TextEncoding& a, const TextEncoding& b) { return a.
name() == b.name(); } |
72 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(); } |
73 | 70 |
74 WTF_EXPORT const TextEncoding& ASCIIEncoding(); | 71 WTF_EXPORT const TextEncoding& ASCIIEncoding(); |
75 WTF_EXPORT const TextEncoding& Latin1Encoding(); | 72 WTF_EXPORT const TextEncoding& Latin1Encoding(); |
76 WTF_EXPORT const TextEncoding& UTF16BigEndianEncoding(); | 73 WTF_EXPORT const TextEncoding& UTF16BigEndianEncoding(); |
77 WTF_EXPORT const TextEncoding& UTF16LittleEndianEncoding(); | 74 WTF_EXPORT const TextEncoding& UTF16LittleEndianEncoding(); |
78 WTF_EXPORT const TextEncoding& UTF32BigEndianEncoding(); | 75 WTF_EXPORT const TextEncoding& UTF32BigEndianEncoding(); |
79 WTF_EXPORT const TextEncoding& UTF32LittleEndianEncoding(); | 76 WTF_EXPORT const TextEncoding& UTF32LittleEndianEncoding(); |
80 WTF_EXPORT const TextEncoding& UTF8Encoding(); | 77 WTF_EXPORT const TextEncoding& UTF8Encoding(); |
81 WTF_EXPORT const TextEncoding& WindowsLatin1Encoding(); | 78 WTF_EXPORT const TextEncoding& WindowsLatin1Encoding(); |
82 | 79 |
83 } // namespace WTF | 80 } // namespace WTF |
84 | 81 |
85 using WTF::ASCIIEncoding; | 82 using WTF::ASCIIEncoding; |
86 using WTF::Latin1Encoding; | 83 using WTF::Latin1Encoding; |
87 using WTF::UTF16BigEndianEncoding; | 84 using WTF::UTF16BigEndianEncoding; |
88 using WTF::UTF16LittleEndianEncoding; | 85 using WTF::UTF16LittleEndianEncoding; |
89 using WTF::UTF32BigEndianEncoding; | 86 using WTF::UTF32BigEndianEncoding; |
90 using WTF::UTF32LittleEndianEncoding; | 87 using WTF::UTF32LittleEndianEncoding; |
91 using WTF::UTF8Encoding; | 88 using WTF::UTF8Encoding; |
92 using WTF::WindowsLatin1Encoding; | 89 using WTF::WindowsLatin1Encoding; |
93 | 90 |
94 #endif // TextEncoding_h | 91 #endif // TextEncoding_h |
OLD | NEW |