I'm using the new C++ <filesystem> library, and all the strings representing file and folder names are returned as const wchar_t* pointers. In my program, I use chars and std::string, which is fine as far as I know because all file paths can be written with ASCII characters (only one byte). There is a way to convert from std::wstring to std::string, but the <codecvt> header that's used for this is deprecated after C++17.
I was wondering, what would be the harm in simply just reading the value of each 2-byte wchar_t into a single-byte char? Whenever you have to convert from std::wstring (I'm assuming UTF-16) to single-byte std::string, any characters greater than 127 or 255 in the std::wstring can't be contained in the char, so they can't be converted in any way, right?