Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
306 views
in Technique[技术] by (71.8m points)

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!
";
        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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...