Boost logo

Boost Users :

Subject: Re: [Boost-users] [filesystem] using locales on Solaris with GCC
From: JonathonS (thejunkjon_at_[hidden])
Date: 2012-09-20 12:53:42


Thanks Lars for the help.

> You could probably stub up a no-op codecvt and pass that in wherever
> Boost.Filesystem has an default codecvt parameter.

I thought of this idea, but unfortunately, this would require the devs
to remember to pass in the stubbed codecvt implementation whenever
they create a filesystem::path object. I guess I could create a
helper function to return a path object, but then again, that would
require them to use my helper function. I don't think they would like
this.

Is there a way to say, "always use this codecvt for all locales" ?

> As I understand it, your explosions is due to the codecvt()
> instantiation itself, not the actual use of it.

Correct. Whenever boost filesystem gets instantiated, it tries to get
the default locale via the invocation std::locale("") which seems to
call the constructor for codecvt. If I was able to replace
std::locale("") with std::locale(), then I think my problem would be
solved because then this would force my customer's to set their locale
via std::locale::global(...) and let them handle the issue :)

Thanks,
J


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net