Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: base/i18n/icu_encoding_detection.cc

Issue 1542323002: Switch to standard integer types in base/i18n/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: header Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/i18n/file_util_icu_unittest.cc ('k') | base/i18n/icu_string_conversions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/i18n/icu_encoding_detection.h" 5 #include "base/i18n/icu_encoding_detection.h"
6 6
7 #include <stdint.h>
8
7 #include <set> 9 #include <set>
8 10
9 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
10 #include "third_party/icu/source/i18n/unicode/ucsdet.h" 12 #include "third_party/icu/source/i18n/unicode/ucsdet.h"
11 13
12 namespace base { 14 namespace base {
13 15
14 bool DetectEncoding(const std::string& text, std::string* encoding) { 16 bool DetectEncoding(const std::string& text, std::string* encoding) {
15 if (IsStringASCII(text)) { 17 if (IsStringASCII(text)) {
16 *encoding = std::string(); 18 *encoding = std::string();
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (sniffed_encodings.find(name) == sniffed_encodings.end()) 91 if (sniffed_encodings.find(name) == sniffed_encodings.end())
90 encodings->push_back(name); 92 encodings->push_back(name);
91 } 93 }
92 uenum_close(detectable_encodings); 94 uenum_close(detectable_encodings);
93 95
94 ucsdet_close(detector); 96 ucsdet_close(detector);
95 return !encodings->empty(); 97 return !encodings->empty();
96 } 98 }
97 99
98 } // namespace base 100 } // namespace base
OLDNEW
« no previous file with comments | « base/i18n/file_util_icu_unittest.cc ('k') | base/i18n/icu_string_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698