Intro
If I catch an exception, I want to convert the error message, which is returned as a C-style string by the what()
method, into a std::u8string
(a UTF-8 string). For example: std::u8string(error.what());
Problem
How can I convert a char*
into a std::u8string
?
Additional Information
- I only catch exceptions from the standard library, boost and eigen.
- My application is Windows dependent, so the solution doesn't need to be portable.