Skip to content
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

Support Time Zone IANA Ids and Windows Ids in all platforms #49412

Merged
merged 7 commits into from
Mar 12, 2021

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Mar 10, 2021

This change is to allow using either IANA Id or Windows Id in any platform to create a TimeZoneInfo object. That will allow users not to worry which Id type work on which platform. Also, we have the issue #49407 tracking exposing the APIs which can be used to convert IANA Ids to Windows Ids and vice versa.

As we depend on ICU library, this functionality will be limited to using the ICU. This is the default mode anyway. This functionality will not be available in the following cases:

  • Running with Globalization Invariant Mode.
  • Switching to use NLS on Windows.
  • Using ICU library version less than 52. The only case I am aware of using version less than 52 is Centos 7 (and matching RHEL version). Upgrading ICU on such platforms will work around the issue there.

@ghost
Copy link

ghost commented Mar 10, 2021

Tagging subscribers to this area: @tarekgh, @safern
See info in area-owners.md if you want to be subscribed.

Issue Details

This change is to allow using either IANA Id or Windows Id in any platform to create a TimeZoneInfo object. That will allow users not to worry which Id type work on which platform. Also, we have the issue #49407 tracking exposing the APIs which can be used to convert IANA Ids to Windows Ids and vice versa.

As we depend on ICU library, this functionality will be limited to using the ICU. This is the default mode anyway. This functionality will not be available in the following cases:

  • Running with Globalization Invariant Mode.
  • Switching to use NLS on Windows.
  • Using ICU library version less than 52. The only case I am aware of using version less than 52 is Centos 7 (and matching RHEL version).
Author: tarekgh
Assignees: -
Labels:

area-System.Globalization

Milestone: -

@tarekgh tarekgh self-assigned this Mar 10, 2021
@tarekgh tarekgh requested review from tqiu8 and safern March 10, 2021 03:24
@tarekgh tarekgh added this to the 6.0.0 milestone Mar 10, 2021
@tarekgh
Copy link
Member Author

tarekgh commented Mar 10, 2021

@mattjohnsonpint I'll wait merging this till you merge yours

@tarekgh
Copy link
Member Author

tarekgh commented Mar 10, 2021

CC @eerhardt @lewing

@mattjohnsonpint
Copy link
Contributor

This should help address #18644, and reduce the need for my TimeZoneConverter library.

@eerhardt
Copy link
Member

This will fix #14929, correct?

@tarekgh
Copy link
Member Author

tarekgh commented Mar 10, 2021

This will fix #14929, correct?

That is right. thanks for linking the issue to this PR.

@tarekgh
Copy link
Member Author

tarekgh commented Mar 10, 2021

@steveisok @lambdageek could you please have a look if you see anything related to the mobile platforms? Thanks!

@tarekgh
Copy link
Member Author

tarekgh commented Mar 11, 2021

@lewing @tqiu8 looks to me that the ICU version used by the browser not having the time zone Id conversion data. I'll let you decide if this feature is important to support in the browser to enable. Let me know if I can help in anything here.

@mattjohnsonpint
Copy link
Contributor

FWIW, browsers use only IANA IDs. I think the scenarios for Windows IDs are mostly server-side or desktop.

@tarekgh
Copy link
Member Author

tarekgh commented Mar 11, 2021

Looks the runtime-dev-innerloop CI failure is tracked by #49309

@tarekgh
Copy link
Member Author

tarekgh commented Mar 11, 2021

Looks the runtime (Build Browser wasm Release AllSubsets_Mono) CI failure is the issue #49499

@tarekgh
Copy link
Member Author

tarekgh commented Mar 12, 2021

#29683

@lewing
Copy link
Member

lewing commented Mar 12, 2021

@lewing @tqiu8 looks to me that the ICU version used by the browser not having the time zone Id conversion data. I'll let you decide if this feature is important to support in the browser to enable. Let me know if I can help in anything here.

It is unfortunate that the only options we have are increasing size or making browser even more unique. @tqiu8 can you take a look at the icu filters and see how much size the conversion data would add?

@lewing
Copy link
Member

lewing commented Mar 12, 2021

This data will impact the mobile icu sizes as well if they want to support it.

@tarekgh
Copy link
Member Author

tarekgh commented Mar 12, 2021

@lewing maybe @mattjohnsonpint comment #49412 (comment) make sense? and the browser should work only with IANA Ids only?

@tqiu8
Copy link
Contributor

tqiu8 commented Mar 12, 2021

@lewing @tqiu8 looks to me that the ICU version used by the browser not having the time zone Id conversion data. I'll let you decide if this feature is important to support in the browser to enable. Let me know if I can help in anything here.

It is unfortunate that the only options we have are increasing size or making browser even more unique. @tqiu8 can you take a look at the icu filters and see how much size the conversion data would add?

Taking the idudt.json filter and enabling metaZones, takes the size of icudt.dat from 1480K to 1676K

@tarekgh
Copy link
Member Author

tarekgh commented Mar 12, 2021

@tqiu8 I think metaZones has a lot of other data that not needed for the name conversion functionality. Do we have the option to tailor the contents of the metaZones?

@tqiu8
Copy link
Contributor

tqiu8 commented Mar 12, 2021

@tarekgh Yes that's definitely possible considering it's just a txt file.

@tarekgh
Copy link
Member Author

tarekgh commented Mar 12, 2021

@tqiu8 that is great. let's give it a try and look what size we get.

@mattjohnsonpint
Copy link
Contributor

mattjohnsonpint commented Mar 12, 2021

Not sure about how ICU bundles it, but strictly speaking about CLDR data, metazones aren't required for Windows ID conversion. Only windowsZones.xml and bcp47/timeZones.xml are needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants