I've tried the font drawing tutorial program, worked without a problem. Then I tried to draw text that uses non-ASCII characters.
I read the text to be displayed from an UTF-8 file.
const sf::Uint8* readStringCpp(){
std::string line("");
std::ifstream mfile("utf8text.txt");
if (mfile.is_open()){
std::getline(mfile,line);
}
return (sf::Uint8*)line.c_str();
}
...
sf::Unicode::Text ucText(readStringCpp());
sf::String Hello(ucText);
Hello.SetFont(MyFont);
Hello.SetColor(sf::Color(0, 128, 128));
Hello.SetPosition(60.f, 120.f);
...
And choose Arial Unicode for font.
The standard text to test Hungarian characters is
"Árvíztűrő tükörfúrógép". Most of the accented characters of this are already in ASCII, except for
Ő and
Ű.
What I've got:
http://i.imgur.com/dpHyN.pngAs you can see, the non-ASCII characters didn't got displayed.
What did I wrong?
If I use wide character literals, I get the same.