Date: Wed, 8 Jul 2026 23:54:58 +0800
On Wed, 8 Jul 2026 at 23:10, Tiago Freire via SG16 <sg16_at_[hidden]>
wrote:
> Problems that do absolutely exist on linux systems. I'm not talking about
> the poor choice of Windows using wchar_t for their native interfaces.
> I'm talking about problems like char doesn't have a signedness defined,
> and that you can change it to be signed or unsigned with a compiler
> setting, a problem that makes checks like " val < 'A' " ill-formed.
> This isn't the case with char8_t, char8_t is unsigned. " val < u8'A' " is
> well-formed.
What is the point of comparing two UTF-8 code units, considering that they
might be part of a UTF-8 character?
One normally does not compare code units at all. It is usual to use
char32_t, or, better, use a dedicated Unicode library that deals with
canonicalization etc.
-YW
wrote:
> Problems that do absolutely exist on linux systems. I'm not talking about
> the poor choice of Windows using wchar_t for their native interfaces.
> I'm talking about problems like char doesn't have a signedness defined,
> and that you can change it to be signed or unsigned with a compiler
> setting, a problem that makes checks like " val < 'A' " ill-formed.
> This isn't the case with char8_t, char8_t is unsigned. " val < u8'A' " is
> well-formed.
What is the point of comparing two UTF-8 code units, considering that they
might be part of a UTF-8 character?
One normally does not compare code units at all. It is usual to use
char32_t, or, better, use a dedicated Unicode library that deals with
canonicalization etc.
-YW
Received on 2026-07-08 15:55:16
