Commit 434d5125 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

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/+/2591883Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71764}
parent 6f290ef7
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment