Hi,
Just found this promising library and then stumbled with an encoding problem.
I use Xcode 4.2 and SFML 2 RC (installer). Source files are encoded in UTF-8.
I am trying to get Cyrillic chars to be shown properly using the SFML Application template:
// Create a graphical text to display
sf::Font font;
if (!font.loadFromFile(resourcePath() + "mplus-1p-medium.ttf"))
return EXIT_FAILURE;
sf::Text text(L"\u043A к k", font, 50);
text.setColor(sf::Color::Black);
(there's a Cyrillic K instead of html code in the source, seems there's a problem with encoding on the forums too :D).
Default font which comes in Resources doesn't have non-Latin characters, so I've tried some other unicode-compitable fonts. And tried to follow similar issues posted on the forum but without much luck.
So, unicode sequence works, but the same Cyrillic letter typed as usual doesn't:
(http://i.imgur.com/ba4yS.png)
Is there a way to solve this in my case?
Nothing helps with title encoding, it's not supported yet ;)
Works perfectly on Windows :). I've tried it on Windows 7 with VS 2010, and both title and sf::Text worked correctly from scratch.
So how do you convert them?
Just this way:
sf::Utf<8>::toWide(str.begin(), str.end(), str1.begin());
Also, seems to be relevant to the issue:
http://stackoverflow.com/questions/9246043/wcslen-works-differently-in-xcode-and-vc