[SG16-Unicode] Hidden locale dependency in [time.duration.io]?
Howard Hinnant
howard.hinnant at gmail.com
Sun Nov 3 10:47:24 CET 2019
The intent is to use Unicode to get “μs” without involving a locale. That would be UTF-8 for char, UTF-16 for a 2 byte wchar_t and UTF-32 for a 4 byte wchar_t. And if for some reason the device can’t deal with Unicode, the vendor can fall back to “us” in the basic character set. In either event, it is not intended to involve a locale, and specifically doesn’t not involve the ctype facet and widening/narrowing. I’m not sure I would call it implementation defined as the vendor isn’t required to document it. But the vendor can choose between the Unicode output, or the “us” approximation.
Feel free to submit an issue, but if you do I strongly recommend suggested wording as the LWG has already been over this paragraph in detail and the current wording is a product of that review.
Howard
On Nov 3, 2019, at 8:16 AM, Tom Honermann <tom at honermann.net> wrote:
>
> I just came across [time.duration.io]p4:
>
> > If Period::type is micro, but the character U+00B5 cannot be represented in the encoding used for charT, the unit suffix "us" is used instead of "μs".
>
> How is the determination as to whether the character can be represented to be done? It seems this would involve consulting the locale. Or is this effectively implementation defined behavior?
>
> Perhaps this is worth an LWG issue to at least clarify the behavior?
>
> Tom.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
Url : http://www.open-std.org/pipermail/unicode/attachments/20191103/613727e1/attachment.bin
More information about the Unicode
mailing list