| 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/utf_string_conversions.h" | 5 #include <stddef.h> |
| 6 #include <string> |
| 6 | 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/logging.h" |
| 10 #include "base/string16.h" |
| 7 #include "base/string_piece.h" | 11 #include "base/string_piece.h" |
| 8 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversion_utils.h" | 13 #include "base/utf_string_conversion_utils.h" |
| 14 #include "build/build_config.h" |
| 10 | 15 |
| 11 using base::PrepareForUTF8Output; | 16 using base::PrepareForUTF8Output; |
| 12 using base::PrepareForUTF16Or32Output; | 17 using base::PrepareForUTF16Or32Output; |
| 13 using base::ReadUnicodeCharacter; | 18 using base::ReadUnicodeCharacter; |
| 14 using base::WriteUnicodeCharacter; | 19 using base::WriteUnicodeCharacter; |
| 15 | 20 |
| 16 namespace { | 21 namespace { |
| 17 | 22 |
| 18 // Generalized Unicode converter ----------------------------------------------- | 23 // Generalized Unicode converter ----------------------------------------------- |
| 19 | 24 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 182 |
| 178 std::wstring ASCIIToWide(const base::StringPiece& ascii) { | 183 std::wstring ASCIIToWide(const base::StringPiece& ascii) { |
| 179 DCHECK(IsStringASCII(ascii)) << ascii; | 184 DCHECK(IsStringASCII(ascii)) << ascii; |
| 180 return std::wstring(ascii.begin(), ascii.end()); | 185 return std::wstring(ascii.begin(), ascii.end()); |
| 181 } | 186 } |
| 182 | 187 |
| 183 string16 ASCIIToUTF16(const base::StringPiece& ascii) { | 188 string16 ASCIIToUTF16(const base::StringPiece& ascii) { |
| 184 DCHECK(IsStringASCII(ascii)) << ascii; | 189 DCHECK(IsStringASCII(ascii)) << ascii; |
| 185 return string16(ascii.begin(), ascii.end()); | 190 return string16(ascii.begin(), ascii.end()); |
| 186 } | 191 } |
| OLD | NEW |