When creating mvce for this question, I figured out the problem. I decided to write it here if it is useful for someone else.
The code snippet shown in the question is part of a huge project, so I had no compilation warning:
warning C4800: 'const wchar_t *': forced value for bool 'true' or 'false' (performance warning)
Then I realized that there is a constructor for Poco::Path::Path(bool absolute) and that the compiler automatically translates from the pointer to bool, creating unexpected behavior. Output \ output corresponds to an empty absolute path, its initial value when using such a constructor.
For those interested in a workaround, I now use the conversion of UTF-16 to UTF-8:
#include <boost/locale/encoding.hpp> // ... std::wstring a_path = L"c:\\temp"; Poco::Path utf8_path(boost::locale::conv::utf_to_utf<char>(a_path));
source share