Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 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 "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include <cstddef> | 35 #include <cstddef> |
| 36 | 36 |
| 37 namespace WTF { | 37 namespace WTF { |
| 38 class String; | |
| 38 class TextEncoding; | 39 class TextEncoding; |
| 39 } | 40 } |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 // Given a sequence of bytes in |data| of length |len| and an optional | 44 // Given a sequence of bytes in |data| of length |len| and an optional |
| 44 // hintEncodingName, detect the most likely character encoding. | 45 // hintEncodingName, detect the most likely character encoding. |
| 45 // The way hintEncodingName is used is up to an implementation. | 46 // The way hintEncodingName is used is up to an implementation. |
| 46 // Currently, the only caller sets it to the parent frame encoding. | 47 // Currently, the only caller sets it to the parent frame encoding. |
| 48 // |hintUrl| is optional. You can pass String(). | |
| 49 // |hintUserLanguage| is an optional language code like "fr". | |
| 47 PLATFORM_EXPORT bool detectTextEncoding(const char* data, | 50 PLATFORM_EXPORT bool detectTextEncoding(const char* data, |
| 48 size_t length, | 51 size_t length, |
| 49 const char* hintEncodingName, | 52 const char* hintEncodingName, |
| 53 const WTF::String& hintUrl, | |
|
Jinsuk Kim
2017/01/20 21:50:47
Can this be of type const char* like other paramet
tkent
2017/01/23 00:02:57
Done.
| |
| 54 const char* hintUserLanguage, | |
| 50 WTF::TextEncoding* detectedEncoding); | 55 WTF::TextEncoding* detectedEncoding); |
| 51 | 56 |
| 52 } // namespace blink | 57 } // namespace blink |
| 53 | 58 |
| 54 #endif | 59 #endif |
| OLD | NEW |