You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@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 the input filename is unicode(at least with Chinese) and use
CLI::ExistingFile
to check it, which will callwiden_impl
indirectly, the linereturn std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>>().from_bytes(str, str + str_size);
failed in Windows.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
, thestd::mbsrtowcs
will fail too.The text was updated successfully, but these errors were encountered: