| 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/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
| 8 #include "base/strings/string_util.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 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 std::wstring ASCIIToWide(const StringPiece& ascii) { | 175 std::wstring ASCIIToWide(const StringPiece& ascii) { |
| 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 std::string UTF16ToASCII(const string16& utf16) { |
| 186 DCHECK(IsStringASCII(utf16)) << UTF16ToUTF8(utf16); |
| 187 return std::string(utf16.begin(), utf16.end()); |
| 188 } |
| 189 |
| 185 } // namespace base | 190 } // namespace base |
| OLD | NEW |