Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Changes for InsertUnicodeExtension #62

Closed
wants to merge 3 commits into from

Conversation

anba
Copy link
Contributor

@anba anba commented Sep 24, 2018

e9155f3

ce7e711

  • Creating a Unicode extension when attributes and keywords are both empty could be misunderstood resp. may not necessarily imply the resulting string is the empty string, so change the condition to check for non-empty attributes and keywords lists.

5bf56ba

  • Calling CanonicalizeLanguageTag is no longer needed now that the caller already passes a canonicalized Unicode extension sequence.

InsertUnicodeExtension is never called when the language tag is a grandfathered or private-use only tag.
…n is present

This avoids an ambiguity how the Unicode BCP 47 U extension should be constructed when the attributes and the keywords lists are both empty.
InsertUnicodeExtension only called CanonicalizeLanguageTag to maximize the shareable number of steps with 9.2.6 ResolveLocale, so that when the Intl.Locale proposal is merged into ECMA-402, ApplyUnicodeExtensionToTag and ResolveLocale can both call InsertUnicodeExtension to insert a Unicode extension into a language tag. And ResolveLocale only calls CanonicalizeLanguageTag so that implementations which implement the optional steps in 6.2.3 CanonicalizeLanguageTag, namely to apply canonicalization of the Unicode extension per RFC 6067, are allowed to use this extension canonicalization after adding the new Unicode extension in ResolveLocale.
But now that Intl.Locale has made the RFC 6067 / UTR 35 canonicalization normative, it no longer makes sense to canonicalize the already canonicalized language tag with an also already canonicalized Unicode extension another time.
@littledan
Copy link
Member

These changes look good, but I guess we should wait to land them until we resolve #63.

@anba
Copy link
Contributor Author

anba commented Oct 16, 2018

Ugh, we still need to CanonicalizeLanguageTag to insert the Unicode extension sequence at the correct position.

@anba anba closed this Oct 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants