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 #include "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
6 | 6 |
7 #include "base/string_util.h" | |
8 #include "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
| 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversion_utils.h" | 9 #include "base/strings/utf_string_conversion_utils.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Generalized Unicode converter ----------------------------------------------- | 15 // Generalized Unicode converter ----------------------------------------------- |
16 | 16 |
17 // Converts the given source Unicode character type to the given destination | 17 // Converts the given source Unicode character type to the given destination |
18 // Unicode character type as a STL string. The given input buffer and size | 18 // Unicode character type as a STL string. The given input buffer and size |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 DCHECK(IsStringASCII(ascii)) << ascii; | 176 DCHECK(IsStringASCII(ascii)) << ascii; |
177 return std::wstring(ascii.begin(), ascii.end()); | 177 return std::wstring(ascii.begin(), ascii.end()); |
178 } | 178 } |
179 | 179 |
180 string16 ASCIIToUTF16(const StringPiece& ascii) { | 180 string16 ASCIIToUTF16(const StringPiece& ascii) { |
181 DCHECK(IsStringASCII(ascii)) << ascii; | 181 DCHECK(IsStringASCII(ascii)) << ascii; |
182 return string16(ascii.begin(), ascii.end()); | 182 return string16(ascii.begin(), ascii.end()); |
183 } | 183 } |
184 | 184 |
185 } // namespace base | 185 } // namespace base |
OLD | NEW |