Remove temp hack which remove true
The fix is already in ICU-20310 Bug: v8:8565 Change-Id: Ifcef1c643ec5ea0cc95f29ee5a3a1962cb5e6b17 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2591883 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#71764}
This commit is contained in:
parent
6f290ef767
commit
434d5125de
@ -588,27 +588,6 @@ Maybe<std::string> Intl::ToLanguageTag(const icu::Locale& locale) {
|
||||
return Nothing<std::string>();
|
||||
}
|
||||
DCHECK(U_SUCCESS(status));
|
||||
|
||||
// Hack to remove -true and -yes from unicode extensions
|
||||
// Address https://crbug.com/v8/8565
|
||||
// TODO(ftang): Move the following "remove true" logic into ICU toLanguageTag
|
||||
// by fixing ICU-20310.
|
||||
size_t u_ext_start = res.find("-u-");
|
||||
if (u_ext_start != std::string::npos) {
|
||||
// remove "-true" and "-yes" after -u-
|
||||
const std::vector<std::string> remove_items({"-true", "-yes"});
|
||||
for (auto item = remove_items.begin(); item != remove_items.end(); item++) {
|
||||
for (size_t sep_remove =
|
||||
res.find(*item, u_ext_start + 5 /* strlen("-u-xx") == 5 */);
|
||||
sep_remove != std::string::npos; sep_remove = res.find(*item)) {
|
||||
size_t end_of_sep_remove = sep_remove + item->length();
|
||||
if (res.length() == end_of_sep_remove ||
|
||||
res.at(end_of_sep_remove) == '-') {
|
||||
res.erase(sep_remove, item->length());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Just(res);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user