Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We uses CLI11 internally to build some of our tools. We are building with MSVC from VS2022, have enabled UNICODE on Windows, as suggested in the UTF-8 Everywhere manifesto and codecvt is available (
CLI11_HAS_CODECVT
is1
). With this setup we have been unable to parse non-ANSI parameters properly.We have tracked the issue back to the
narrow
implementation. Specifically on Windows,codecvt_utf8_utf16
is used to convertstr
. Even though the type iswchar_t
it is NOT an UTF-16 string. It's actually an UCS-2 string.CLI11/include/CLI/impl/Encoding_inl.hpp
Line 65 in 3afddf3
According to the documentation, codecvt_utf8<wchar_t> convert UTF-8 to/from UCS-2 on Windows and to/from UTF-32 on other platforms.
This probably fixes #1042