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

Normative: Canonicalize value of extension in ApplyUnicodeExtensionToTag #846

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion spec/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ <h1>
1. Let _optionsValue_ be _options_.[[&lt;_key_&gt;]].
1. If _optionsValue_ is not *undefined*, then
1. Assert: Type(_optionsValue_) is String.
1. Set _value_ to _optionsValue_.
1. Let _optionsUValue_ be the ASCII-lowercase of _optionsValue_.
1. Set _value_ to the String value resulting from canonicalizing _optionsUValue_ as a value of key _key_ per <a href="https://unicode.org/reports/tr35/#processing-localeids">Unicode Technical Standard #35 Part 1 Core, Annex C LocaleId Canonicalization Section 5 Canonicalizing Syntax, Processing LocaleIds</a>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResolveLocale also explicitly converts key to ASCII lower-case before this step. Should we do the same here? (key is already in ASCII lower-case, so it's not strictly required to perform any case conversions, neither here nor in ResolveLocale.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In here, Inside 14.1.3 ApplyUnicodeExtensionToTag ( tag, options, relevantExtensionKeys )
https://tc39.es/ecma402/#sec-apply-unicode-extension-to-tag
5. For each element key of relevantExtensionKeys, do

and only place call it is in
14.1.1 Intl.Locale ( tag [ , options ] )
https://tc39.es/ecma402/#sec-Intl.Locale
29. Let r be ApplyUnicodeExtensionToTag(tag, opt, relevantExtensionKeys).

where relevantExtensionKeys is from
2. Let relevantExtensionKeys be %Locale%.[[RelevantExtensionKeys]].

and %Locale%.[[RelevantExtensionKeys]] is defined in
https://tc39.es/ecma402/#sec-intl.locale-internal-slots
"The value of the [[RelevantExtensionKeys]] internal slot is « "ca", "co", "hc", "kf", "kn", "nu" ». If %Collator%.[[RelevantExtensionKeys]] does not contain "kf", then remove "kf" from %Locale%.[[RelevantExtensionKeys]]. If %Collator%.[[RelevantExtensionKeys]] does not contain "kn", then remove "kn" from %Locale%.[[RelevantExtensionKeys]]."

I agree with you that the "converts key to ASCII lower-case" in ResolveLocale is also unnecessary. But that is another editoral issue we can change separately

1. If _entry_ is not ~empty~, then
1. Set _entry_.[[Value]] to _value_.
1. Else,
Expand Down
Loading