converting utility::string_t to std::string

Jul 30, 2015 at 7:43 AM
Hi All,

I have following scenario where i need to convert utility::string_t to std::string
I got to know that utility::string_t is essentially a typedef to std::string. Then why conversion is not possible.

Please help on this query.
My whole project uses std::string and I cant afford to make changes in entire project.

Is there any way out??

Regards,
Pooja
Coordinator
Jul 30, 2015 at 7:54 PM
There are conversion functions in the utility::conversions namespace, which can convert between all the relevant string types.

http://microsoft.github.io/cpprestsdk/namespaceutility_1_1conversions.html

You probably will want to_utf8string() and to_string_t()
Marked as answer by roschuma on 7/31/2015 at 12:23 PM