I'm developing a game (actually I'm porting it from Gosu to SFML) in C++. I'm using GNU Gettext as the i18n system. As you know, gettext returns char *
strings using the local encoding, usually UTF8. The problem is that I need to use wide strings for SFML to recognize the special characters such as áéíüñ
.
So the question would be: how do I create a proper wstring
from the output of gettext? It would be great if there were some kind of wchar_t * w_gettext()
function, but there's not. I have tried some options, such as creating a wstring
from the original string
by passing the iterators, but obviously it does not work.