Boost logo

Boost :

From: Alexander Grund (alexander.grund_at_[hidden])
Date: 2022-08-16 07:00:28

Am 15.08.22 um 23:10 schrieb Peter Dimov via Boost:
> Andrey Semashev wrote:
>> On 8/15/22 22:35, Peter Dimov via Boost wrote:
>>> The usual approach is to put
>>> boost::filesystem::path::imbue( std::locale( std::locale::classic(),
>>> new boost::filesystem::detail::utf8_codecvt_facet ) );
>> I'd rather
>> boost::filesystem::path::imbue(boost::locale::generator()("C.UTF-8"));
>> Don't recommend users to use stuff from namespace detail. :)
> Sound advice in principle but that's pretty much the established practice
> at this point. Perhaps we should expose a non-detail way to perform the
> above, such as provide a function "set_utf8_as_default".
Is it? I see `boost::locale::generator().generate("")` being used more
often, e.g. (quick Google search):

And there is `boost::nowide::nowide_filesystem()` doing pretty much what
you suggest:

Am 16.08.22 um 00:21 schrieb Andrey Semashev via Boost:
> On 8/16/22 01:07, Peter Dimov via Boost wrote:
>> Andrey Semashev wrote:
>>> Perhaps, move utf8_codecvt_facet to Utility or Core?
>> Maybe it's time. And make it all inline?
> Yes.
> Although there's this already:

And again in Nowide:

Am 16.08.22 um 01:53 schrieb Vinnie Falco via Boost:
> (where is the signature of fopen that accepts a filesystem::path?).
That's outside of its purpose: It is meant to accept narrow strings,
UTF-8 encoded where applicable.

Boost list run by bdawes at, gregod at, cpdaniel at, john at