SFML community forums
Help => Graphics => Topic started by: on February 04, 2012, 09:42:32 am
-
Hello!
I use SFML 1.6 in my game, and when i draw russian letter, i saw strange ieroglyphs. I found threads on this forum, read it, but this don't help.
Font1.LoadFromFile("arial.ttf", 24,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя");
String ControlString(Unicode::Text("Жми Р.\nPress P for play."),Font1,24);
Latin character draw normaly, but russian text stay as ieroglyphs.
And now i don't want use SFML2.0
Sorry my bad English.=)
-
On SFML2 i have the same problem, because MinGW has only "C" locale.
-
Yes, it's probably an encoding issue. It should work if you provide the UTF-32 values of your characters directly ("\uXXX" with XXX the hexadecimal Unicode codepoint of the character). Maybe a wide string would be enough (L"blahblah").
-
Thanks for help!
When i trying to use wstring, compiller return error"Illegal byte sequence". And \u sequence didn't help.
-
When i trying to use wstring, compiller return error"Illegal byte sequence"
Show your code ;)
And \u sequence didn't help
Show your code ;)
-
I set editor encoding to UTF8, and wstring now working.
Font Font1;
wstring str=L"абв!";
Font1.LoadFromFile("arial.ttf", 24,"\u0410\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437"); //some russian character
String SFstr(str,Font1,24);
-
It's working!
Font Font1;
wstring str=L"Русский текст тут абв!";
Font1.LoadFromFile("arial.ttf", 24,str);
String SFstr(str,Font1,24);
Thank you very much!