@root42 "As the Unicode standard and security experts point out, ill-formed UTF can be and has been used as an attack vector. Yet the <codecvt> facets don’t provide the safe forms of error handling as their defaults, and it is far to
hard to use them in a safe way."
1/3
@root42 "Reports from users in the field indicated repeated attempts to use this facility, as a part of the standard library bearing the most useful name suggested this should be our best practice, only to repeatedly fail for subtle reasons in our underspecification, leading to many home-grown solutions instead after much wasted time."
2/3
@root42 https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2871r0.pdf
I was involved in reviewing this paper and 100% agree with the decision to deprecate and remove <codecvt>. The question is not, "Why was this added?" but should be, "Why was this added in the first place?"
3/3
@krans my question is: why isn't there a safe and good replacement in the standard...?
@root42 There's a replacement currently in the pipeline.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2728r6.html