I have this string (core::stringw)
Code: Select all
core::stringw allo = L"français";
Code: Select all
gui->setText(allo);
It can be quickly fixed by changing the line to this:
Code: Select all
gui->setText(allo.c_str());
If I define directly as wchar_t and sent it as the proper type, it display correctly.fran ais
So I deducted that the using of .c_str(); will string every accented characters from the string.
Is there a way to do a conversion from core::stringw to wchar_t* but by preserving the accented characters?
EDIT: Found a way to have this working but really not sure about the code. The extended character are preserved using this:
Code: Select all
// Temp fix to get the extended characters not being removed inside.
text::stringw = "Français"
core::stringc source = text.c_str(); // Irrlicht widestrings
char *mtext = (char *)source.c_str(); // char buffer
wchar_t buffer[65536]; //widestring buffer (64k limit)
mbstowcs(buffer, mtext, strlen(mtext))
setText(buffer);