widen convert faild in Windows
If the input filename is unicode(at least with Chinese) and use CLI::ExistingFile to check it, which will call widen_impl indirectly, the line return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>>().from_bytes(str, str + str_size); failed in Windows.
PS D:\temp\ac> .\ac_cli.exe '.\read - 副本.jpg'
terminate called after throwing an instance of 'std::range_error'
what(): wstring_convert::from_bytes
I'm using Windows 11 and C++17 standard, and this happend in both VS2022 and MinGW64 gcc 14.1.0.
if I disable CLI11_HAS_CODECVT, the std::mbsrtowcs will fail too.
Any possibility you could write a failing test in the test cases and add in a PR?
@phlptp I think I found the problem. In the Chinese version of Windows, the default encoding for the terminal is GBK (page 936), while CLI11 uses it as utf8, so the convert failed.
Does CLI11 have plans to support local 8-bit encoding?
If someone knows how to fix it, we could. Don't use Windows or local encodings, or know how to test local encodings in CI.