Open BillyONeal opened 4 years ago
This is a dual of Microsoft-internal VSO-365507 and its duplicate VSO-364730.
Is this doable for a first time contributor?
@rlintott Unfortunately it's ABI breaking to fix, that's why it's tagged vNext.
(Which means that we're unable to fix this in the VS 2019 release series, regardless of contributor. We'll be starting work on a "vNext" binary-incompatible release at some point in the future, but the timing isn't certain and is many months away for sure.)
Is this solved in VS 2022? If this is marked as obsolete in C++17, why there is no replacement for C++20?
Is this solved in VS 2022?
VS2022 is still ABI compatible with previous releases, so no.
If this is marked as obsolete in C++17, why there is no replacement for C++20?
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0618r0.html
There's no reasonable way to report errors in a way consistent with Unicode, nor was it implemented correctly by any of the implementations (although this one is particularly bad).
Notably, the main reason you would want something like this would be so that it would work with std::fstream but it doesn't even work for that, since no UTF-8 <-> UTF-16 conversion can comply with the 1:N constraint ( http://eel.is/c++draft/locale.codecvt#virtuals-4 ) because 3 UTF-8 encoding units result in 2 UTF-16 encoding units.
We have been recommending people use MultiByteToWideChar
or WideCharToMultiByte
instead and indeed that's what we use:
Just to be curious, couldn't you just provide both. The original implementation with the original internal namespace and a new one which is reachable via std::wstring_convert
but has a slightly different internal inlined namespace?
That would preserve abi compatibility and fixes the issue for every newly compiled binaries. Although this is probably wasted effort for this particular case since it's deprecated in anyway.
Describe the bug The standard says that
wstring_convert
is to delete the supplied facet, but we don't appear to be doing that. See https://eel.is/c++draft/depr.conversions.string#18The current implementation puts the facet into a std::locale object which may or may not delete the facet on completion.
Command-line test case STL version (git commit or Visual Studio version):
This is a dual of Microsoft-internal VSO-364730 / AB#364730.
vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.