Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Error C2679 in asyncrt_utils.h file while building C++ REST project

$
0
0
Hi UdayJ,

The problem is the http_headers::add(...) method works by using the stream operator << on an ostringstream_t (see the function print_string in asyncrt_utils.h at line 151). Which on Windows means it works with a 2 byte character UTF-16 string. In the future we might look at making a few places like this also work with UTF-8 strings on Windows.

To work around simply convert you std::string to a string_t with:
request.headers().add(header_names::authorization, ::utility::conversions::to_string_t(auth));
Thanks,
Steve

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>