8000 Replace wchar_t with char32_t and wstring with u32string by daniel-larraz · Pull Request #11994 · cvc5/cvc5 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace wchar_t with char32_t and wstring with u32string #11994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

daniel-larraz
Copy link
Contributor

wchar_t has a platform-dependent size: on Windows, it is 16-bit (UTF-16), while on Linux and macOS, it is 32-bit (UTF-32). However, the current implementation assumes that wchar_t is always 32 bits. char32_t and std::u32string are designed specifically for Unicode, whereas wchar_t and std::wstring predate Unicode standardization and were intended for "wide" characters, not necessarily Unicode. Unfortunately, although char32_t is part of C11, the <uchar.h> header, where char32_t should be defined, is missing in Apple Clang, so we explicitly provide the definition in such cases.

Copy link
Member
@aniemetz aniemetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally LGTM, but introduces breaking changes in the API. Can we deprecate the old functions instead of removing them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0