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

Unified Diff: components/autofill/core/browser/credit_card.cc

Issue 2740673002: Prepare Chromium and Blink for ICU 59 (Closed)
Patch Set: revert accidental revert of sftnly roll during rebase Created 3 years, 9 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
Index: components/autofill/core/browser/credit_card.cc
diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
index bd5110eced381942dacf830dbe8b81740375c37c..0e54c44176abd4a59c4418bb569331a95469e561 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -13,6 +13,7 @@
#include "base/guid.h"
#include "base/i18n/time_formatting.h"
+#include "base/i18n/unicodestring.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
@@ -870,7 +871,8 @@ bool CreditCard::ConvertMonth(const base::string16& month,
int32_t num_months;
const icu::UnicodeString* months = date_format_symbols.getMonths(num_months);
for (int32_t i = 0; i < num_months; ++i) {
- const base::string16 icu_month(months[i].getBuffer(), months[i].length());
+ const base::string16 icu_month(
+ base::i18n::UnicodeStringToString16(months[i]));
if (compare.StringsEqual(icu_month, month)) {
*num = i + 1; // Adjust from 0-indexed to 1-indexed.
return true;
@@ -883,7 +885,7 @@ bool CreditCard::ConvertMonth(const base::string16& month,
base::string16 trimmed_month;
base::TrimString(month, ASCIIToUTF16("."), &trimmed_month);
for (int32_t i = 0; i < num_months; ++i) {
- base::string16 icu_month(months[i].getBuffer(), months[i].length());
+ base::string16 icu_month(base::i18n::UnicodeStringToString16(months[i]));
base::TrimString(icu_month, ASCIIToUTF16("."), &icu_month);
if (compare.StringsEqual(icu_month, trimmed_month)) {
*num = i + 1; // Adjust from 0-indexed to 1-indexed.
« no previous file with comments | « components/autofill/core/browser/autofill_profile_comparator.cc ('k') | components/bookmarks/browser/titled_url_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698