Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::asio::buffer + std::wstring
From: Luke Walker (luke_walker_at_[hidden])
Date: 2011-12-28 14:54:36


----------------------------------------
> From: boost.lists_at_[hidden]
> Date: Wed, 28 Dec 2011 11:48:27 +0200
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] boost::asio::buffer + std::wstring
>
> > The issue isn't writing nor object lifetime. If I use std::string objects the receiver gets all of the content but with std::wstring only 1/4 of the content is received.
>
> It's the same buffer() function both for std::string and std::wstring:
Right. On linux the data loss is 3/4 and on windows it's 1/2. Coincidently wchar_t is 4 bytes on linux and 2 bytes on windows. It seems as if boost::asio::buffer is treating it internally as 1 byte.
:-/
>
> template
> inline const_buffers_1 buffer(const std::basic_string Allocator>& data);
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
                                               


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