OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 WTF_EXPORT ConversionResult convertUTF16ToUTF8( | 64 WTF_EXPORT ConversionResult convertUTF16ToUTF8( |
65 const UChar** sourceStart, const UChar* sourceEnd, | 65 const UChar** sourceStart, const UChar* sourceEnd, |
66 char** targetStart, char* targetEnd, bool strict = true); | 66 char** targetStart, char* targetEnd, bool strict = true); |
67 | 67 |
68 WTF_EXPORT unsigned calculateStringHashAndLengthFromUTF8MaskingTop8Bits(const ch
ar* data, const char* dataEnd, unsigned& dataLength, unsigned& utf16Length); | 68 WTF_EXPORT unsigned calculateStringHashAndLengthFromUTF8MaskingTop8Bits(const ch
ar* data, const char* dataEnd, unsigned& dataLength, unsigned& utf16Length); |
69 | 69 |
70 WTF_EXPORT bool equalUTF16WithUTF8(const UChar* a, const UChar* aEnd, const char
* b, const char* bEnd); | 70 WTF_EXPORT bool equalUTF16WithUTF8(const UChar* a, const UChar* aEnd, const char
* b, const char* bEnd); |
71 WTF_EXPORT bool equalLatin1WithUTF8(const LChar* a, const LChar* aEnd, const cha
r* b, const char* bEnd); | 71 WTF_EXPORT bool equalLatin1WithUTF8(const LChar* a, const LChar* aEnd, const cha
r* b, const char* bEnd); |
72 | 72 |
| 73 |
| 74 // Given a sequence of bytes in |data| of length |len|, check if the content is |
| 75 // encoded in UTF-8. Pure ASCII text is not regarded as UTF-8 in order to |
| 76 // respect the default encoding since it can be of any encoding. |
| 77 WTF_EXPORT bool isUTF8Encoded(const char* data, size_t length); |
| 78 |
73 } // namespace Unicode | 79 } // namespace Unicode |
74 } // namespace WTF | 80 } // namespace WTF |
75 | 81 |
76 #endif // WTF_UTF8_h | 82 #endif // WTF_UTF8_h |
OLD | NEW |