Re: [webauthn] Unicode "tag" characters are deprecated for language tagging (#1642)

I drew an [action item](https://www.w3.org/International/track/actions/1213) to reply directly to @xorgy's comment.

The short answer is: the mechanism isn't "truly broken" from the point of view that one could use it to encode language tags into strings. But Unicode deprecated this use and the technical reasons behind not using this mechanism are pretty long, including:

* the encoding is particularly inefficient (the tag characters and introducer/cancel tags each require 4 bytes in any of the Unicode encodings (UTF-32, UTF-16, UTF-8))
* the mechanism alters string data and requires the introspection and alteration of string data to/from the application; that is, in order to send an arbitrary string value down the wire, I have to use a special function to attach the language tag and another to remove it on the receiving end. Further, the tag characters have to be converted to their ASCII equivalent before being used in e.g. the HTML `lang` attribute.
* not all rendering systems ignore the tags (should one choose _not_ to remove them) and they may show as "tofu" (hollow boxes), interfering with usability
* rendering systems don't understand the tags, so they don't help with font selection, shaping, and other rendering/processing unless they are processed and passed as markup or to `setLanguage`/`setLocale` APIs.

There are some advantages to these tags. Notably they can be used "in-band" to tag substrings: most ASCII based syntaxes, such as those found in JSON-LD, only permit the whole of the string to be tagged with a language. However, the encoding efficiency problem remains and someone receiving multi-language string would have to do a fair amount of work to make use of that tagging.  

It's much easier (and likely more interoperable) if webAuthn provides a separate optional field or uses one of the ASCII schemes instead. If webAuthn insisted on using this mechanism, I18N would not object. But we don't think it makes sense.

-- 
GitHub Notification of comment by aphillips
Please view or discuss this issue at https://github.com/w3c/webauthn/issues/1642#issuecomment-1282653209 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 18 October 2022 16:16:05 UTC