Skip to content

Commit

Permalink
Normative: Update String toLocale{Lower,Upper}Case to ResolveLocale w…
Browse files Browse the repository at this point in the history
…ith best-fit matching

Fixes #896
  • Loading branch information
gibson042 committed Jan 30, 2025
1 parent 239f27c commit 70accc6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions spec/locale-sensitive-functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ <h1>
</dl>
<emu-alg>
1. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_).
1. If _requestedLocales_ is not an empty List, then
1. Let _requestedLocale_ be _requestedLocales_[0].
1. Else,
1. Let _requestedLocale_ be DefaultLocale().
1. Let _availableLocales_ be an Available Locales List which includes the language tags for which the Unicode Character Database contains language-sensitive case mappings. If the implementation supports additional locale-sensitive case mappings, _availableLocales_ should also include their corresponding language tags.
1. Let _match_ be LookupMatchingLocaleByPrefix(_availableLocales_, « _requestedLocale_ »).
1. If _match_ is not *undefined*, let _locale_ be _match_.[[locale]]; else let _locale_ be *"und"*.
1. Let _opt_ be the Record { [[localeMatcher]]: *"best fit"* }.
1. Let _relevantExtensionKeys_ be a new empty List.
1. Let _r_ be ResolveLocale(_availableLocales_, _requestedLocales_, _opt_, _relevantExtensionKeys_).
1. Let _locale_ be _r_.[[Locale]].
1. Let _codePoints_ be StringToCodePoints(_S_).
1. If _targetCase_ is ~lower~, then
1. Let _newCodePoints_ be a List whose elements are the result of a lowercase transformation of _codePoints_ according to an implementation-derived algorithm using _locale_ or the Unicode Default Case Conversion algorithm.
Expand Down

0 comments on commit 70accc6

Please sign in to comment.