Normative: Add more explicit algorithms for lookups#92
Merged
FrankYFTang merged 8 commits intotc39:mainfrom Nov 18, 2025
Merged
Normative: Add more explicit algorithms for lookups#92FrankYFTang merged 8 commits intotc39:mainfrom
FrankYFTang merged 8 commits intotc39:mainfrom
Conversation
FrankYFTang
approved these changes
Oct 8, 2025
Collaborator
|
We discuss this PR in TG2 2025-10-09 meeting and got all positive feedback and prefer to merge. Frank will bring to 2025 Nov TC39 TG1 meeting . |
dminor
approved these changes
Oct 9, 2025
FrankYFTang
added a commit
to FrankYFTang/ecma402
that referenced
this pull request
Nov 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add more explicit steps which should match the results when using ICU4C.
Being more explicit which Unicode extension keys are used is important for implementations like SpiderMonkey, which has to sanitize the locale identifier before passing it to ICU4C. SpiderMonkey allows locale identifier longer than
ULOC_FULLNAME_CAPACITY(157 characters), so we have to sanitize the locale identifier before passing it to ICU4C, otherwise ICU4C will reject the locale identifier withU_BUFFER_OVERFLOW_ERROR. (I think this also applies to JSC.) V8 directly calls into ICU4C, so it inherits theULOC_FULLNAME_CAPACITYrestrictions and can't even createIntl.Localewith long locale identifiers.When to use
rgorsdor even fall back to the default locale seems a bit arbitrarily to me, but that's the current ICU4C behaviour, so it's what users will get in browsers. 🤷a27bd64:
rgandsdUnicode extension keys to lookup the region."gregory"resp."h23"if no calendar or time data is available.df2d9cc:
rgandsdUnicode extension keys are ignored."ltr"when no script metadata is available. (This case can happen if the script's metadata usesUNKNOWNfor theRTLproperty or if the script is invalid.)81e9d12:
%Intl.NumberFormat%to lookup the default numbering system.rgandsdUnicode extension keys are ignored."latn"if the locale isn't found in the available locales list of%Intl.NumberFormat%.23d08eb:
%Intl.NumberFormat%to lookup the default numbering system.rgandsdUnicode extension keys are ignored.%Intl.Collator%.Applies on top of #91.