G
G
German2019-01-09 18:12:35
C++ / C#
German, 2019-01-09 18:12:35

Boost asio and Russian text?

There is such a function

const string host = "api.adialca.com";
  string target = "/info.php?source=app&" + request;
  if (isMessage)
    target = "/info.php?source=app_message&" + request;
  string tmp = host + target;
  io_service service;
  ip::tcp::resolver resolver(service);
  ip::tcp::socket socket(service);
  connect(socket, resolver.resolve(host, "80"));
  http::request<http::string_body> req(http::verb::get, target, 11);
  req.set(http::field::host, host);
  req.set(http::field::user_agent, BOOST_BEAST_VERSION_STRING);
  http::write(socket, req);
  {
    boost::beast::flat_buffer buffer;
    http::response<http::dynamic_body> res;
    http::read(socket, buffer, res);
  }
  socket.shutdown(ip::tcp::socket::shutdown_both);

It works great with string, but how to rewrite it to wstring or wchar_t in order to use Russian in queries?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question