Opened 10 years ago

Closed 10 years ago

#7388 closed Bugs (fixed)

path::wchar_t_codecvt_facet() on linux always ignore my locale, which I set by path::imbue

Reported by: Brazhnick Kirill <kirk2003@…> Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

Hello! Sorry, in this code of path::wchar_t_codecvt_facet:

  const path::codecvt_type*& path::wchar_t_codecvt_facet()
  {
#   if defined(BOOST_POSIX_API) && \
      !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
      // A local static initialized by calling path::imbue ensures that std::locale(""),
      // which may throw, is called only if path_locale and condecvt_facet will actually
      // be used. Thus misconfigured environmental variables will only cause an
      // exception if a valid std::locale("") is actually needed.
      static std::locale posix_lazy_initialization(path::imbue(std::locale("")));
#   endif
    return codecvt_facet;
  }

after string

posix_lazy_initialization(path::imbue(std::locale("")));

codecvt_facet which I set by path::imbue(_myLocaleWithFacet_) replacing by codecvt_facet from default locale std::locale("").

In CGI-application, worked arround context of Apache server, default locale always POSIX. But I need support unicode names of files.

Forgive me once again but I hope on your help and your support in the solvation of this problem.

Change History (2)

comment:1 by viboes, 10 years ago

Component: Nonefilesystem
Owner: set to Beman Dawes

comment:2 by Beman Dawes, 10 years ago

Resolution: fixed
Status: newclosed

Boost.Filesystem's implementation of path locale and codecvt handling has been rewritten with much simpler, more portable, and hopefully more robust code. The interface has not changed. The rewrite has been applied to svn trunk as of revision 83062. An added reference documentation section (boost-root/libs/filesystem/doc/reference.html#path-Usage) describes class path usage concerns, such as thread data races.

These changes should resolve this issue. If you believe it has not been resolved satisfactorily, please open a new issue rather than reopening this issue. But before you do that, please read boost-root/libs/filesystem/doc/reference.html#path-Usage to be sure that the problem you are seeing is not a manifestation of one of the those concerns. If you do open a new issue, please be specific and supply a test case and lots of details. Just saying something "doesn't work" or "crashes" is not enough!

Thanks,

--Beman

Note: See TracTickets for help on using tickets.