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

[Editorial] Truncation description inaccurate #1645

Open
aphillips opened this issue Jul 9, 2021 · 1 comment
Open

[Editorial] Truncation description inaccurate #1645

aphillips opened this issue Jul 9, 2021 · 1 comment
Assignees
Labels
i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. @Risk Items that are at risk for L3 type:editorial
Milestone

Comments

@aphillips
Copy link

6.4.2. Language and Direction Encoding
https://www.w3.org/TR/webauthn-2/#sctn-strings-langdir

Consumers of strings that may have language and direction encoded should be aware that truncation could truncate a language tag into a different, but still valid, language. The final directionality marker or CANCEL TAG code point provide an unambigous indication of truncation.

Naive truncation of a language tag will not produce a valid language tag. Language tags will only remain valid if truncated just before a hyphen character (and noting that single-character or "singleton" subtags should not appear at the end of a language tag). It is also possible that a badly handled truncation scheme could change the meaning of a tag. For example:

tlh => tl (from Klingon to Tagalog)
hi-Deva = hi-De (from Hindi-written-in-Devanagari to Hindi-as-used-in-Germany)

A proper truncation here should describe using U+E002D (the equivalent of the hyphen character in language tags) to find subtags for removal.

Note that while the CANCEL TAG's absence probably doesn't introduce any rendering issues, note that the resulting strings concatenation with other strings could result in strange or unintended rendering.

The term "valid" may also be problematic here, since in BCP47 a language tag is valid if and only if each subtag has been checked for existence in the registry. The normal term of art here is "well-formed".

@aphillips aphillips added the i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. label Jul 9, 2021
@agl
Copy link
Contributor

agl commented Jul 19, 2021

I think this issue results from a misunderstanding.

The truncation in question here is the result of authenticators blindly truncating these fields at a given byte length. Since the language tag is at the end, such truncation could transform a language tag into another language, like the Klingon to Tagalog change that you note. The fact that a directionality marker or CANCEL TAG always follows the language allows for an implementation to be aware that truncation occurred and thus potentially ignore the language tag.

@nadalin nadalin added this to the L3-WD-01 milestone Sep 22, 2021
@nadalin nadalin added the @Risk Items that are at risk for L3 label Jun 27, 2023
@plehegar plehegar modified the milestones: L3-WD-01, L3-WD-02 Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. @Risk Items that are at risk for L3 type:editorial
Projects
None yet
Development

No branches or pull requests

5 participants