1
General / Unicode encoding
« on: May 05, 2014, 03:35:25 am »
Hello, (sorry for my poor english)
I have a "problem" while trying to get a character from my keyboard, I use this:
I searched and saw some methods to do it, but no one work for me.
I tried a lot of things, like simply cast it into a char or pass by a sf::string ... etc, and nothing worked.
Characters typed on my keyboard are stocked into a std::string, and then I just want to display this string by a sf::text
Could someone give me the missing line to convert my unicode string into a displayable string ?
Thank you
(and again, sorry for my english)
I have a "problem" while trying to get a character from my keyboard, I use this:
Quote
event.text.unicodeto retreive it, but after that I don't know how to convert it into ascii.
I searched and saw some methods to do it, but no one work for me.
I tried a lot of things, like simply cast it into a char or pass by a sf::string ... etc, and nothing worked.
Characters typed on my keyboard are stocked into a std::string, and then I just want to display this string by a sf::text
Quote
std::string s = "";
//event keypressed
s += event.text.unicode;
//In my rendering thread
sf::Text text;
text.setString(s);
window->draw(text);
Could someone give me the missing line to convert my unicode string into a displayable string ?
Thank you
![Smiley :)](https://www.sfml-dev.org/forums/Smileys/default/smiley.gif)