Consider converting from wchar_t to char32_t, everywhere. #18

Open
opened 2026-03-30 14:25:14 +00:00 by simon · 0 comments
Owner

So far I've used wchar_t as the C type for characters, everywhere. The meaning of this is ambiguous; it may be interpreted as meaning 16 bits, or 32 bits. I have allowed 32 bits, everywhere.

Today I learned that there's an alternative definition, char32_t, which is unambiguously 32 bit.

This is currently only defined (as far as I can see) in headers intended for use with C++, but it might be worth using.

So far I've used wchar_t as the C type for characters, everywhere. The meaning of this is ambiguous; it may be interpreted as meaning 16 bits, or 32 bits. I have allowed 32 bits, everywhere. Today I learned that there's an alternative definition, `char32_t`, which is unambiguously 32 bit. This is currently only defined (as far as I can see) in headers intended for use with C++, but it might be worth using.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: simon/post-scarcity#18
No description provided.