Boost logo

Boost :

Subject: Re: [boost] [nowide] Request for interest (nowide unicode support for windows)
From: Artyom (artyomtnk_at_[hidden])
Date: 2010-06-15 15:38:06


> > > > >> > > >> Can I write: > > >> > > >>  boost::filesystem::fstream > f("שלום.txt",std::ios_base::out); > > >> > > >> When "שלום.txt" is UTF-8 string and > Unicode file name will be created? > > >> If so, way to go. > > >> > > > > > > In v3, yes. > > > > There are some caveats, but it should work, and there > are some fairly > > similar test cases passing all compilers. > > This is not what I'd understood from our previous > discussion.  I was under > the impression filesystem v3 running on Windows would take > this narrow path > string and convert it to UTF-16 using the *local code > page*.  This means > the example above would only work if the computer in > question were set to > Hebrew.  > > [snip] > > Did I misunderstand? Yes, you did. When I was talking about UTF-8 I mean Unicode and not subset. For example, in my case I want to open a file std::ofstream f("سلام-שלום-Peace-Мир.txt") I can't do this on Windows (only) So I open it with nowide::ofstream f("سلام-שלום-Peace-Мир.txt") And it works on Windows as well. The only operating system that does not allow **any** file being opened with std::fstream::open or std::fopen is Windows and this is what the library wants to fix. You can download my code there: http://art-blog.no-ip.info/files/nowide.zip It gives you: STL's nowide::ifstream nowide::ofstream nowide::fstream nowide::filebuf STDlib's nowide::fopen nowide::freopen nowide::remove nowide::rename All using UTF-8 strings (as it usually work on all modern operating systems) Artyom


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk