What's the crash? What's the call stack? Do you mix debug and release version?
You don't really need to convert L"" to std::wstring first.
I set "release" to CMAKE_BUILD_TYPE.
It should always crash if I mix debug and release version.
My SFML library is download from the official website.(Not compile it by myself)
-----------Error message box give me this-----------
Debug error!
Program:
D:\...\my_project.exe
abort() has been called
(Press Retry to debug the application)
-----------------------------------------------------------
// It crash too
std::string str("just a UTF-8 string");
return sf::String::fromUtf8( str.begin(), str.end() );