Open tahonermann opened 5 years ago
@cubbimew Thank you for that 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)
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.
btowc
andwctob
are unable to provide conversions for code points that require multiple code units in variable length encodings.mbtowc
andwctomb
are able to handle code points that require multiple code units, but depend on global state and are therefore not thread safe.mbrtowc
andwcrtomb
have superseded both.