Skip to content
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

Deprecate btowc, wctob, mbtowc, and wctomb #39

Open
tahonermann opened this issue Nov 18, 2018 · 4 comments
Open

Deprecate btowc, wctob, mbtowc, and wctomb #39

tahonermann opened this issue Nov 18, 2018 · 4 comments
Labels
help wanted Extra attention is needed paper needed A paper proposing a specific solution is needed

Comments

@tahonermann
Copy link
Member

btowc and wctob are unable to provide conversions for code points that require multiple code units in variable length encodings. mbtowc and wctomb are able to handle code points that require multiple code units, but depend on global state and are therefore not thread safe. mbrtowc and wcrtomb have superseded both.

@tahonermann tahonermann added help wanted Extra attention is needed paper needed A paper proposing a specific solution is needed labels Nov 18, 2018
@cubbimew
Copy link

cubbimew commented Nov 21, 2018

Note WG14 has a proposal to make mbtowc and wctomb thread-safe: n2281.
Minutes say "Agree with the goal in principle" and "The paper needs more work"

@tahonermann
Copy link
Member Author

@cubbimew Thank you for that link!

@cubbimew
Copy link

If btowc/wctob can be considered for deprecation, what about implicit conversions between char and wchar_t? Those are even more broken (they are basically btowc/wctob minus error-checking) and more sneaky (e.g. they let you construct a garbage wstring from a string iterator pair)

@tahonermann
Copy link
Member Author

I agree those conversions are more broken. I don't know how realistic it would be to make changes for wchar_t (and char16_t and char32_t), but it would be nice it we could. I've been leaning more towards leaving code unit/code point types as is and introducing new "character" types that are not integral types and do not participate in the traditional integral promotions/conversions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed paper needed A paper proposing a specific solution is needed
Development

No branches or pull requests

2 participants