Search code examples
c++boost

C++ boost system::error_code language


i executed this code as TCP client:

        boost::system::error_code error;
        const std::string msg = "Hello from Client!\n";
        boost::asio::write(socket, boost::asio::buffer(msg), error);
        std::cout << "error.message(): " << error.message() << std::endl;

and got this message: error.message(): ╬яхЁрЎш  єёях°эю чртхЁ°хэр

I use windows 10. Should i change language somewhere? Why it is not readable.


Solution

  • Try to insert setlocale(0, ""); before printing the message;