-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix Time Zone Id Conversion with Lowercased Regions #53315
Fix Time Zone Id Conversion with Lowercased Regions #53315
Conversation
Tagging subscribers to this area: @tannergooding Issue DetailsFixes #53279 In the
|
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.FullGlobalizationData.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.FullGlobalizationData.cs
Show resolved
Hide resolved
The failures in the CI looks tracked by the issue #53311 |
Is ASCII required in a standard somewhere or just in practice? |
It is Latin alpha characters which is technically is the ASCII alpha characters. Also, it can be numbers for countries which don't use Latin scripts.
The Wikipedia table is useful to see all assigned codes and which not assigned. |
Co-authored-by: Martin Costello <martin@martincostello.com>
@stephentoub could you please have a look and approve it if it looks ok to you? 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.
sorry - hit the wrong button, but I can't delete this.
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.
Hello @stephentoub! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Fixes #53279
In the
TimeZoneInfo.TryConvertWindowsIdToIanaId
we use ICU to convert the Windows time zone Ids to IANA Ids. One of the parameters used in this API is the region name. Unfortunately, ICU always expect the region name to be uppercased and return unexpected results if passed lowercased region names. This change is to ensure we pass uppercased region names to ICU.The change here manually uppercasing the region names to avoid extra string allocation as the valid region names are short anyway and will have all character in ASCII range.