Started by ingar, 07 May 2019, 21:53:12
Quote from: ingar on 07 May 2019, 21:53:12Hi all,A general question:Are there any ways of supporting Unicode in TGUI? I am hoping to be able to replace a Windows CE application with a TGUI app. But the Windows CE app is connecting to a server that returns UTF8 data.And I cannot see how to TGUI can display those Japanese names...Ingar
Quote from: texus on 04 June 2019, 16:22:00I don't see anything wrong with your steps.Maybe storing the buffer in an std::string can be skipped if fromUtf8 supports a begin and end pointer (I'm not sure if it does), but it will work equally well when first stored in an std::string.The type is Uint32 because it stores the string as UTF32. Two bytes wouldn't be enough to store ALL possible unicode characters.If squares are displayed then it would mean that the chosen font (arial.ttf in this case) does not contain these japanese characters.
const char* buffer = "\x41\x42\xe6\x9d\xb1\xe4\xba\xac";text->setText(sf::String::fromUtf8(&buffer, &buffer));