@@ -380,6 +380,7 @@ class asio_context : public request_context, public std::enable_shared_from_this
380
380
381
381
const auto &host = base_uri.host ();
382
382
std::ostream request_stream (&m_body_buf);
383
+ request_stream.imbue (std::locale::classic ());
383
384
384
385
request_stream << method << " " << encoded_resource << " " << " HTTP/1.1" << CRLF << " Host: " << host;
385
386
@@ -768,6 +769,7 @@ class asio_context : public request_context, public std::enable_shared_from_this
768
769
m_timer.reset ();
769
770
770
771
std::istream response_stream (&m_body_buf);
772
+ response_stream.imbue (std::locale::classic ());
771
773
std::string http_version;
772
774
response_stream >> http_version;
773
775
status_code status_code;
@@ -783,9 +785,6 @@ class asio_context : public request_context, public std::enable_shared_from_this
783
785
784
786
if (!response_stream || http_version.substr (0 , 5 ) != " HTTP/" )
785
787
{
786
- printf (" HTTP VERSION:%s\n " , http_version.c_str ());
787
- printf (" Status_code:%hu\n " , status_code);
788
- printf (" Status message:%s\n " , status_message.c_str ());
789
788
report_error (" Invalid HTTP status line" , ec, httpclient_errorcode_context::readheader);
790
789
return ;
791
790
}
@@ -826,6 +825,7 @@ class asio_context : public request_context, public std::enable_shared_from_this
826
825
{
827
826
auto needChunked = false ;
828
827
std::istream response_stream (&m_body_buf);
828
+ response_stream.imbue (std::locale::classic ());
829
829
std::string header;
830
830
while (std::getline (response_stream, header) && header != " \r " )
831
831
{
@@ -913,6 +913,7 @@ class asio_context : public request_context, public std::enable_shared_from_this
913
913
m_timer.reset ();
914
914
915
915
std::istream response_stream (&m_body_buf);
916
+ response_stream.imbue (std::locale::classic ());
916
917
std::string line;
917
918
std::getline (response_stream, line);
918
919
0 commit comments