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 retrieval of normalize IANA names, including aliases #4031
Comments
Can we use the AsciiTrie itself to store the canonical identifiers? IIUC it currently stores lowercase identifiers, and we convert requests to lowercase before doing a lookup. Instead, it could store the canonical identifiers and provide a case-insensitive lookup function. To do this, at every node it checks the input character first, and tries the other case if there's no match. |
Discussion:
Conclusion: |
Fixes #4031 Replaces #4548 This new all-in-one type supports all of the time zone ID operations we need, with some operations being asymptotically faster than others. Not sure if we want to deprecate the old ones or keep them around, at least IanaBcp47RoundTripMapper. It's not completely obsolete since it has different performance characteristics. --------- Co-authored-by: Robert Bastian <[email protected]>
#4024 allows for accessing the canonical IANA identifier for a given time zone. However, it does not allow case normalization of non-canonical time zones. For example, Temporal requires that "asia/calcutta" be echoed back to the user as "Asia/Calcutta".
To implement this, add another data key that contains the normalized strings for all IANA names that are non-canonical. Sort them by their lowercase value, then look them up with a binary search.
Expose this as an API such as
The text was updated successfully, but these errors were encountered: