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

Add and use BCP-47 time-zone identifiers in TimeZonesProvider #606

Closed
nordzilla opened this issue Apr 3, 2021 · 3 comments · Fixed by #1687
Closed

Add and use BCP-47 time-zone identifiers in TimeZonesProvider #606

nordzilla opened this issue Apr 3, 2021 · 3 comments · Fixed by #1687
Assignees
Labels
C-datetime Component: datetime, calendars, time zones S-medium Size: Less than a week (larger bug fix or enhancement) T-core Type: Required functionality

Comments

@nordzilla
Copy link
Member

nordzilla commented Apr 3, 2021

Right now we are using the full IANA-style time-zone IDs from CLDR.

We would like to move toward using the BCP-47 identifiers so that we can store the time-zone IDs as TinyStrings.

Depends on

@nordzilla nordzilla self-assigned this Apr 3, 2021
@nordzilla nordzilla added C-datetime Component: datetime, calendars, time zones T-core Type: Required functionality labels Apr 3, 2021
@nordzilla nordzilla modified the milestone: ICU4X 0.3 Apr 3, 2021
@nordzilla nordzilla added the S-medium Size: Less than a week (larger bug fix or enhancement) label Apr 3, 2021
@sffc sffc added this to the ICU4X 0.3 milestone Apr 19, 2021
@sffc
Copy link
Member

sffc commented Apr 19, 2021

Blocked on #562

@sffc sffc added the blocked A dependency must be resolved before this is actionable label Apr 19, 2021
@dminor
Copy link
Contributor

dminor commented May 7, 2021

@nordzilla We plan to release 0.3 in about 3 weeks. Do you expect this to be unblocked in time for the 0.3 release, or should we punt to 0.4?

@nordzilla nordzilla modified the milestones: ICU4X 0.3, ICU4X 0.4 Jul 13, 2021
@nordzilla nordzilla changed the title Replace time-zone IDs with BCP-47 identifiers Use BCP-47 identifiers as TimeZone IDs Jul 22, 2021
@nordzilla nordzilla changed the title Use BCP-47 identifiers as TimeZone IDs Add and use BCP-47 time-zone identifiers in TimeZonesProvider Aug 25, 2021
@nordzilla nordzilla removed their assignment Aug 25, 2021
@sffc sffc added the help wanted Issue needs an assignee label Aug 26, 2021
@sffc sffc removed the blocked A dependency must be resolved before this is actionable label Sep 16, 2021
@sffc sffc removed the help wanted Issue needs an assignee label Sep 16, 2021
@sffc sffc modified the milestones: ICU4X 0.4, ICU4X 0.5 Oct 21, 2021
@sffc
Copy link
Member

sffc commented Feb 15, 2022

We have not documented the reasons why we need this. Here is the motivation:

  1. Shorter strings means smaller data size.
  2. Fixed-length strings means we can stack-allocate time zone identifiers.
  3. Using a BCP47-compatible identifier means we can consider breaking the time zone data down using the -u-tz extension during vertical fallback.

A note on data size: much of the benefit of data size can be realized by using a hashing algorithm instead of the BCP47 strings. We prefer BCP47 because:

  1. Strings are hand-curated to be human readable and prevent collisions
  2. The data file is more readable
  3. Simpler code / easier to maintain; no dependence on a proprietary hashing algorithm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-datetime Component: datetime, calendars, time zones S-medium Size: Less than a week (larger bug fix or enhancement) T-core Type: Required functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants