Subject: [Boost-bugs] [Boost C++ Libraries] #5769: fstream.hpp facilities not usable for paths containing characters outside of the current Windows ("ANSI") code page on GCC (mingw/mingw-w64)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-08-10 13:25:49
#5769: fstream.hpp facilities not usable for paths containing characters outside
of the current Windows ("ANSI") code page on GCC (mingw/mingw-w64)
-------------------------------+--------------------------------------------
Reporter: sam@⦠| Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.46.1 | Severity: Problem
Keywords: |
-------------------------------+--------------------------------------------
GCC's libstdc++ does not follow MS VC++'s lead in extending std::fstream
and std::filebuf to take paths made up of wchar_t strings.
boost::filesystem::filebuf and {i,o,}fstream rely on this functionality.
In its absence, they fall back to converting the path's wchar_t
representation into a char string in the Windows ("ANSI") code page of the
current system locale (actually, they incorrectly use the current thread
codepage, see #5592).
The fstream facilities are therefore unusable with GCC when you build a
Windows program that manipulates paths containing characters that are not
representable in the current Windows code page.
When compiled with the GCC from mingw-w64, the attached test will fail to
create a file. Examination with Process Monitor reveals that the program
tries to create a file with the name of "umbre??a", because the â
character is not representable in any Windows code page.
GCC provides a __gnu_cxx::stdio_filebuf, which may be constructed from a
FILE* or file descriptor; this could be used in concert with MSVCRT's
_wfopen or _wopen functions, by boost::filesystem::{i,o,}fstream to
provide the missing functionality.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5769> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC