Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fusion] wide-char output
From: Leo Cacciari (leo.cacciari_at_[hidden])
Date: 2017-04-05 17:47:38

On Wed, Apr 5, 2017 at 6:43 PM, Mark Stallard <stallard_at_[hidden]> wrote:
> Forgive me if I'm missing something obvious: Could the problem be that your passing char-based strings to an output stream expecting wchar_t-based text?

No, it's a 'char *', not a std::string, and this is definitely valid:

    std::cout << "foobar" << std::endl;

> Couldn't you fix this by writing to std:cout instead of std::wcout?

No, because the actual structure I will use contains members that are
std::wstring (and those can not be sent to std::cout directly).

Nor can those std::wstring be made std::string. Leaving out the hassle
of converting the encoding without a C+11 compiler (I'm stuck with
MSVC9), there is the problem that these data are windows system data
(device properties, in fact) that must be read and writen back in wide
char. So I'll have to convert between 8- and 16-bits encoding all the
time... Ugly! :)

Leo Cacciari
Aliae nationes servitutem pati possunt. Populi Romani est propria libertas.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at