C++ Logo

sg16

Advanced search

Should we get rid of UCS-2 and ISO 10646:2003

From: Corentin <corentin.jabot_at_[hidden]>
Date: Sat, 3 Dec 2022 15:11:27 +0100
Hey folks.
We only mention UCS-2 in [depr.locale.stdcvt.req]
http://eel.is/c++draft/depr#locale.stdcvt.req

Referring to UCS-2 forces to carry a reference to ISO 10646:2003, as this
encoding has long been obsoleted.

We could remove it entirely by rewording slightly, without changing any
effect.

For the facet codecvt_­utf8:

   - The facet shall convert between UTF-8 multibyte sequences and UCS-2 or
   UTF-32 (depending on the size of Elem) within the program.

=>

   - The facet shall convert between UTF-8 multibyte sequences and UTF-16
   or UTF-32 (depending on the size of Elem) within the program.
   - When converting to UTF-16 if any UTF-8 sequence encodes a codepoint
   outside of the BMP, the behavior is undefined.

For the facet codecvt_­utf16:

   - The facet shall convert between UTF-16 multibyte sequences and UCS-2
   or UTF-32 (depending on the size of Elem) within the program

=>

   - The facet shall convert between UTF-16 multibyte sequences and UTF-16
   or UTF-32 (depending on the size of Elem) within the program.
   - When converting to UTF-16 if any UTF-8 sequence encodes a codepoint
   outside of the BMP, the behavior is undefined.


What do you think?

Corentin

Received on 2022-12-03 14:11:41