Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - cppvoid

Pages: [1]
1
System / Save/Load a vector<sf::String> without data lost
« on: June 12, 2016, 01:15:41 pm »
What is the simplest method to save or load a couple of sf::Strings without data lost?

   std::ifstream file("example.txt");
   string standardLine;

   if(!file)    return false;

   while(std::getline(file, standardLine))
   {
         std::basic_string<sf::Uint32> utf32;
         sf::Utf8::toUtf32(standardLine.begin(), standardLine.end(), std::back_inserter(utf32));
         
         strings.push_back(utf32);
   }
 

This seems not to work correctly the output looks like the wrong encoding. example.txt is filled with Unicode characters and the output of a loaded sf::String looks like this: [][][][][][][]

Pages: [1]
anything