我有以下ANSII代码:
boost::asio::streambuf buffer;
std::ostream oss(&buffer);
boost::asio::async_write(socket_, buffer,
strand_.wrap(
boost::bind(&Connection::handleWrite, shared_from_this(),
boost::asio::placeholders::error)));
我需要将它转换成UNICODE编码。我尝试了以下方法:
boost::asio::basic_streambuf<std::allocator<wchar_t>> buffer;
std::wostream oss(&buffer);
boost::asio::async_write(socket_, buffer,
strand_.wrap(
boost::bind(&Connection::handleWrite, shared_from_this(),
boost::asio::placeholders::error)));
有没有一种方法可以在UNICODE中使用async_write()?