Boost logo

Boost Users :

Subject: Re: [Boost-users] Problem with the filesystem::exists()
From: Brian Budge (brian.budge_at_[hidden])
Date: 2011-09-27 16:04:36


On Tue, Sep 27, 2011 at 12:49 PM, Danilo da Silveira Figueira
<danilo_at_[hidden]> wrote:
> I'm using WindowsXP but I need a solution that works on any version of
> windows. The encoding of file names appears to be ANSI and the string that
> was passed as a parameter seems to be UTF-8. Here is a link to the problem
> that i'm having.
> http://boost.codepad.org/nmwVlgta
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

I believe it expects a std::string in ASCII or a std::wstring assuming
UTF-16 on windows. If your file is not ascii, you need to either
convert to the current internationalized code page (untested by me) or
UTF-16.

I had issues like this recently where on Linux we expect a std::string
containing UTF-8, so we had the same thing happening on Windows. This
didn't work for non-ascii items, so we convert to UTF-16 on windows,
which then works properly.

  Brian


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