OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef TextEncodingDetector_h | 31 #ifndef TextEncodingDetector_h |
32 #define TextEncodingDetector_h | 32 #define TextEncodingDetector_h |
33 | 33 |
| 34 #include <cstddef> |
34 #include "platform/PlatformExport.h" | 35 #include "platform/PlatformExport.h" |
35 #include <cstddef> | |
36 | 36 |
37 namespace WTF { | 37 namespace WTF { |
38 class TextEncoding; | 38 class TextEncoding; |
39 } | 39 } |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 // Given a sequence of bytes in |data| of length |len| and an optional | 43 // Given a sequence of bytes in |data| of length |len| and an optional |
44 // hintEncodingName, detect the most likely character encoding. | 44 // hintEncodingName, detect the most likely character encoding. |
45 // The way hintEncodingName is used is up to an implementation. | 45 // The way hintEncodingName is used is up to an implementation. |
46 // Currently, the only caller sets it to the parent frame encoding. | 46 // Currently, the only caller sets it to the parent frame encoding. |
47 // |hintUrl| is optional. You can pass nullptr. | 47 // |hintUrl| is optional. You can pass nullptr. |
48 // |hintUserLanguage| is an optional language code like "fr", and can be | 48 // |hintUserLanguage| is an optional language code like "fr", and can be |
49 // |nullptr. | 49 // |nullptr. |
50 PLATFORM_EXPORT bool detectTextEncoding(const char* data, | 50 PLATFORM_EXPORT bool detectTextEncoding(const char* data, |
51 size_t length, | 51 size_t length, |
52 const char* hintEncodingName, | 52 const char* hintEncodingName, |
53 const char* hintUrl, | 53 const char* hintUrl, |
54 const char* hintUserLanguage, | 54 const char* hintUserLanguage, |
55 WTF::TextEncoding* detectedEncoding); | 55 WTF::TextEncoding* detectedEncoding); |
56 | 56 |
57 } // namespace blink | 57 } // namespace blink |
58 | 58 |
59 #endif | 59 #endif |
OLD | NEW |