| 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 f8a1ce7544e4c184729de03834b661a85cfcf120..77483285a950949479d82e1f7b453d0401afb8f5 100644
|
| --- a/net/base/net_string_util_icu.cc
|
| +++ b/net/base/net_string_util_icu.cc
|
| @@ -11,7 +11,8 @@
|
|
|
| namespace net {
|
|
|
| -bool ConvertToUtf8(const std::string& text, const char* charset,
|
| +bool ConvertToUtf8(const std::string& text,
|
| + const char* charset,
|
| std::string* output) {
|
| output->clear();
|
|
|
| @@ -26,8 +27,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();
|
| @@ -38,25 +44,27 @@ 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 ConvertLatin1ToUtf8AndNormalize(const std::string& text,
|
| - std::string* output) {
|
| - return net::ConvertToUtf8AndNormalize(text, base::kCodepageLatin1, output);
|
| + std::string* output) {
|
| + return net::ConvertToUtf8AndNormalize(text, base::kCodepageLatin1, 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 ConvertLatin1ToUTF16(const std::string& text, base::string16* output) {
|
| - return base::CodepageToUTF16(text, base::kCodepageLatin1,
|
| - base::OnStringConversionError::FAIL, output);
|
| + return base::CodepageToUTF16(
|
| + text, base::kCodepageLatin1, base::OnStringConversionError::FAIL, output);
|
| }
|
|
|
| } // namespace net
|
|
|