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

Side by Side Diff: base/strings/utf_string_conversions.cc

Issue 176843022: Move UTF16ToASCII, remove WideToASCII. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « base/strings/utf_string_conversions.h ('k') | chrome/app/client_util.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) 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
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
OLDNEW
« no previous file with comments | « base/strings/utf_string_conversions.h ('k') | chrome/app/client_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698