I am trying to create a program with Irrlicht that loads certain things from a configuration file written in Lua, one of which is the window title. However, the lua_tostri
lua_tostri
You can use mbstowcs:
wchar_t WBuf[100]; mbstowcs(WBuf,lua_tostring( /*...*/ ),99);
or more safe:
const char* sz = lua_tostring(/*...*/); std::vector vec; size_t len = strlen(sz); vec.resize(len+1); mbstowcs(&vec[0],sz,len); const wchar_t* wsz = &vec[0];