SFML community forums

Help => Graphics => Topic started by: alwayslearning on April 13, 2010, 12:49:44 am

Title: [solved]sf::events::TextEvent question
Post by: alwayslearning on April 13, 2010, 12:49:44 am
Defined within TextEvent is Uint32 Unicode.

Is there an std type that can natively support the that type in the form of a string?  I'm currently using std::wstring, but warnings are making me cast to wchar_t when saving the event data to the wstring.  Or is wstring the best option?

I just want to make sure I'm not accidently casting away valid data.
Title: [solved]sf::events::TextEvent question
Post by: Laurent on April 13, 2010, 08:20:33 am
You can make a string of any character type:
Code: [Select]
typedef std::basic_string<sf::Uint32> u32string;

// std::string  is std::basic_string<char>
// std::wstring is std::basic_string<wchar_t>
Title: [solved]sf::events::TextEvent question
Post by: alwayslearning on April 14, 2010, 01:15:11 am
Thanks!