Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_I18N_ICU_ENCODING_DETECTION_H_ | 5 #ifndef BASE_I18N_ICU_ENCODING_DETECTION_H_ |
| 6 #define BASE_I18N_ICU_ENCODING_DETECTION_H_ | 6 #define BASE_I18N_ICU_ENCODING_DETECTION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | |
| 10 | 11 |
| 11 namespace base { | 12 namespace base { |
| 12 | 13 |
| 13 // Detect encoding of |text| and put the name of encoding (as returned by ICU) | 14 // Detect encoding of |text| and put the name of encoding (as returned by ICU) |
| 14 // in |encoding|. For ASCII texts |encoding| will be set to an empty string. | 15 // in |encoding|. For ASCII texts |encoding| will be set to an empty string. |
| 15 // Returns true on success. | 16 // Returns true on success. |
| 16 bool DetectEncoding(const std::string& text, std::string* encoding); | 17 bool DetectEncoding(const std::string& text, std::string* encoding); |
| 17 | 18 |
| 19 // Detect all possible encodings of |text| and put their names | |
| 20 // (as returned by ICU) in |encodings|. Returns true on success. | |
| 21 bool DetectAllEncodings(const std::string& text, | |
|
eroman
2010/11/16 00:35:03
It doesn't look like the return value is used anyw
Paweł Hajdan Jr.
2010/11/16 21:22:39
That was actually my mistake. Added a check of the
| |
| 22 std::vector<std::string>* encodings); | |
| 23 | |
| 18 } // namespace base | 24 } // namespace base |
| 19 | 25 |
| 20 #endif // BASE_I18N_ICU_ENCODING_DETECTION_H_ | 26 #endif // BASE_I18N_ICU_ENCODING_DETECTION_H_ |
| OLD | NEW |