currently, I'm trying getting acquainted with wxWidgets. So far, everything was fine, but now I'm having a problem with wxFileDialog (wxWidgets 3.2.1).
I would like to open a file in order to parse it. And for reasons I have a function that expects a std::filesystem::path for this. I quickly noticed, that it doesn't work for file names with umlauts if I use openFileDialog.GetPath().ToStdString() to get the path to the file. So I switched to .ToStdWstring(). It looks like this:
Code: Select all
if (openFileDialog.ShowModal() == wxID_CANCEL)
return;
std::wstring pathString{openFileDialog.GetPath().ToStdWstring()};
std::filesystem::path path(pathString);
auto numSellersImported = readSellersFromCsvFile(path, m_market);
So maybe I misunderstood something and I do it the wrong way. Let me put the question this way: How should I use the wxFileDialog in order to open any file, even if the file name containts some special characters like umlauts?