I'm still relatively new to C++, and I chose SFML over SDL based on advise from various others. Working in a multi-language environment, I figured I'd try and get something working with multiple languages.
I've used the initial SFML2 Tutorial, and modified it a little after poking around the documentation. But I still can't get a simple hello world to work with anything outside the ASCII range. What am I doing wrong please?
All I get is 5 square blocks displayed. And so far this is just Japanese, I'd like to throw Korean and Chinese at this too.
My source code is here:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(300, 200), "SFML works!");
sf::Font myFont;
myFont.loadFromFile("arial.ttf");
//myFont.getDefaultFont();
sf::String s;
s = L"こんにちは";
//s = "Test";
sf::Text myText;
myText.setString(s);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(myText);
window.display();
}
return 0;
}