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

Unified Diff: net/base/net_string_util_icu.cc

Issue 266053002: Implement alternative string conversion functions in net/ on Android, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove GN changes Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/net_string_util.h ('k') | net/base/net_string_util_icu_alternatives_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..435f9de24888faec5b93e9a3ca1df4858c73d1c2 100644
--- a/net/base/net_string_util_icu.cc
+++ b/net/base/net_string_util_icu.cc
@@ -11,6 +11,8 @@
namespace net {
+const char* const kCharsetLatin1 = base::kCodepageLatin1;
+
bool ConvertToUtf8(const std::string& text, const char* charset,
std::string* output) {
output->clear();
@@ -43,20 +45,18 @@ bool ConvertToUtf8AndNormalize(const std::string& text, const char* charset,
return base::ConvertToUtf8AndNormalize(text, charset, output);
}
-bool ConvertLatin1ToUtf8AndNormalize(const std::string& text,
- std::string* output) {
- return net::ConvertToUtf8AndNormalize(text, base::kCodepageLatin1, output);
-}
-
bool ConvertToUTF16(const std::string& text, const char* charset,
base::string16* 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);
+bool ConvertToUTF16WithSubstitutions(const std::string& text,
+ const char* charset,
+ base::string16* output) {
+ return base::CodepageToUTF16(text, charset,
+ base::OnStringConversionError::SUBSTITUTE,
+ output);
}
} // namespace net
« no previous file with comments | « net/base/net_string_util.h ('k') | net/base/net_string_util_icu_alternatives_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698