0

I am trying to create something with SFML.

I want to detect what character does the user type and to store it into a variable. Then I want to display it with the sf::Text. It sounds easy but I want to use cyrillic.

K Works
  • 21
  • 6

1 Answers1

2

There is a whole paragraph called

How to avoid problems with non-ASCII characters?

in the tutorials section of SFML on Texts and fonts (Click here to get there).

When you follow it, you should be fine.

The sf::String class accepts both UNICODE and ANSI texts as constructor parameters, so you should be fine whatever input you get.

Hiura
  • 3,500
  • 2
  • 20
  • 39
nvoigt
  • 75,013
  • 26
  • 93
  • 142
  • text.setString(L"יטאח"); if I use this then only rectangles are printed @nvoigt – K Works May 27 '16 at 17:20
  • @K Works You, of course, also need to be using a font that actually contains the characters you want to display. Glyphs are not magically conjoured up, they need to be there in the font. – Jesper Juhl May 27 '16 at 17:25
  • but if I type text.setString(L"здр"); the comiler shows error : Converting to execution character set Illegal sequence @Jesper – K Works May 27 '16 at 17:32
  • @KWorks By the way, which compiler are you using? – nvoigt May 27 '16 at 19:37
  • There is my new topic http://stackoverflow.com/questions/37507044/sfml-dsplayng-cyrillic-text-from-file @nvoigt – K Works May 29 '16 at 12:38