New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICU-20478 Sort variant in (for|to)LanguageTag of icu::Locale and ULocale #836
Conversation
cca2476
to
df8b57d
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
df8b57d
to
0f5e9d7
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
icu4c/source/common/uloc_tag.cpp
Outdated
for (VariantListEntry* var1 = first; var1 != NULL; var1 = var1->next) { | ||
for (VariantListEntry* var2 = var1->next; var2 != NULL; var2 = var2->next) { | ||
// Swap var1->variant and var2->variant. | ||
if (strcmp(var1->variant, var2->variant) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the ICU4C library code, we want to use uprv_str...() functions not raw str...().
In this case, we would also get inconsistent sort orders for EBCDIC vs. ASCII, which would make your test cases fail on an EBCDIC machine, so actually the right one to use is uprv_compareInvCharsAsAscii(s1, s2) from internal uinvchar.h. (EBCDIC sorts digits after letters.)
(This is not a concern in Java which uses Unicode strings.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL adddressed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm please squash
FYI remember that if you following the "Details" link on the jira-ticket checker you can squash from the UI there |
1bfad7e
to
19b9d98
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
please approve after the force-push. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm tnx
- upstream bug: https://unicode-org.atlassian.net/browse/ICU-20478 - upstream PR: unicode-org/icu#836 Bug: v8:9741 Change-Id: I92bed94b7c729d730ca849189a99ffe7906a310e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/1889172 Reviewed-by: Jungshik Shin <jshin@chromium.org>
Checklist