My current code is:
namespace fs = std::filesystem;
void printAllInPath(std::filesystem::path a)
{
for (auto const& dir_entry : fs::recursive_directory_iterator(a))
{
std::cout << dir_entry << "\n";
}
}
The thing is, once it gets to a file with a special character in their name (like the special e, Chinese characters, symbols, etc.), it throws an exception, and my program goes kaput.
Is there a simple solution to this problem?
Thank you all in advance.