| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <stdio.h> |
| 6 #include <string> |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/string16.h" |
| 10 #include "base/third_party/icu/icu_utf.h" |
| 5 #include "base/utf_string_conversion_utils.h" | 11 #include "base/utf_string_conversion_utils.h" |
| 6 | 12 #include "build/build_config.h" |
| 7 #include "base/third_party/icu/icu_utf.h" | |
| 8 | 13 |
| 9 namespace base { | 14 namespace base { |
| 10 | 15 |
| 11 // ReadUnicodeCharacter -------------------------------------------------------- | 16 // ReadUnicodeCharacter -------------------------------------------------------- |
| 12 | 17 |
| 13 bool ReadUnicodeCharacter(const char* src, | 18 bool ReadUnicodeCharacter(const char* src, |
| 14 int32 src_len, | 19 int32 src_len, |
| 15 int32* char_index, | 20 int32* char_index, |
| 16 uint32* code_point_out) { | 21 uint32* code_point_out) { |
| 17 // U8_NEXT expects to be able to use -1 to signal an error, so we must | 22 // U8_NEXT expects to be able to use -1 to signal an error, so we must |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // character. | 144 // character. |
| 140 output->reserve(src_len / 2); | 145 output->reserve(src_len / 2); |
| 141 } | 146 } |
| 142 } | 147 } |
| 143 | 148 |
| 144 // Instantiate versions we know callers will need. | 149 // Instantiate versions we know callers will need. |
| 145 template void PrepareForUTF16Or32Output(const char*, size_t, std::wstring*); | 150 template void PrepareForUTF16Or32Output(const char*, size_t, std::wstring*); |
| 146 template void PrepareForUTF16Or32Output(const char*, size_t, string16*); | 151 template void PrepareForUTF16Or32Output(const char*, size_t, string16*); |
| 147 | 152 |
| 148 } // namespace base | 153 } // namespace base |
| OLD | NEW |