This patch tries to provide the two missing constructors for std::filesystem::path using an instance of std::locale to convert the source.
Given that the source needs to be converted using the codecvt<wchar_t, char, mbstate_t> facet of the std::locale at first, these two constructors:
- Can only take a char source.
- Need to have different path than the current two other constructors taking a source.
After converting to a wchar_t source using the codecvt, we need to convert a second time to store the result. The standard is unclear on how the second conversion should happen:
Otherwise a conversion is performed using the codecvt<wchar_t, char, mbstate_t> facet of loc, and then a second conversion to the current ordinary encoding.
I interpreted this as the second conversion can be executed however we want, meaning that I can reuse the facilities from the two constructors that accept any kind of source.
For the tests, this patch contains both exhaustive testing using an already existing list of paths but also a check that the first conversion is indeed using codecvt<wchar_t, char, mbstate_t> to avoid any regression in the internal logic.