| Index: net/base/net_string_util_icu.cc
|
| diff --git a/net/base/net_string_util_icu.cc b/net/base/net_string_util_icu.cc
|
| index 435f9de24888faec5b93e9a3ca1df4858c73d1c2..cebb872daf18c8cfca29c16761ee936189354859 100644
|
| --- a/net/base/net_string_util_icu.cc
|
| +++ b/net/base/net_string_util_icu.cc
|
| @@ -13,7 +13,8 @@ namespace net {
|
|
|
| const char* const kCharsetLatin1 = base::kCodepageLatin1;
|
|
|
| -bool ConvertToUtf8(const std::string& text, const char* charset,
|
| +bool ConvertToUtf8(const std::string& text,
|
| + const char* charset,
|
| std::string* output) {
|
| output->clear();
|
|
|
| @@ -28,8 +29,13 @@ bool ConvertToUtf8(const std::string& text, const char* charset,
|
| // trailing '\0'.
|
| size_t output_length = text.length() * 3 + 1;
|
| char* buf = WriteInto(output, output_length);
|
| - output_length = ucnv_toAlgorithmic(UCNV_UTF8, converter, buf, output_length,
|
| - text.data(), text.length(), &err);
|
| + output_length = ucnv_toAlgorithmic(UCNV_UTF8,
|
| + converter,
|
| + buf,
|
| + output_length,
|
| + text.data(),
|
| + text.length(),
|
| + &err);
|
| ucnv_close(converter);
|
| if (U_FAILURE(err)) {
|
| output->clear();
|
| @@ -40,23 +46,24 @@ bool ConvertToUtf8(const std::string& text, const char* charset,
|
| return true;
|
| }
|
|
|
| -bool ConvertToUtf8AndNormalize(const std::string& text, const char* charset,
|
| +bool ConvertToUtf8AndNormalize(const std::string& text,
|
| + const char* charset,
|
| std::string* output) {
|
| - return base::ConvertToUtf8AndNormalize(text, charset, output);
|
| + return base::ConvertToUtf8AndNormalize(text, charset, output);
|
| }
|
|
|
| -bool ConvertToUTF16(const std::string& text, const char* charset,
|
| +bool ConvertToUTF16(const std::string& text,
|
| + const char* charset,
|
| base::string16* output) {
|
| - return base::CodepageToUTF16(text, charset,
|
| - base::OnStringConversionError::FAIL, output);
|
| + return base::CodepageToUTF16(
|
| + text, charset, base::OnStringConversionError::FAIL, output);
|
| }
|
|
|
| bool ConvertToUTF16WithSubstitutions(const std::string& text,
|
| const char* charset,
|
| base::string16* output) {
|
| - return base::CodepageToUTF16(text, charset,
|
| - base::OnStringConversionError::SUBSTITUTE,
|
| - output);
|
| + return base::CodepageToUTF16(
|
| + text, charset, base::OnStringConversionError::SUBSTITUTE, output);
|
| }
|
|
|
| } // namespace net
|
|
|