Hey guys, I've made a game in windows and was trying to port it to Linux. The game uses accents, so in windows I use std::wstrings. However, in linux, you don't have to use wstrings, but std::strings.
However, I have a problem: In windows works perfectly, but in linux it doesn't.
Example code
#include <iostream>
#include <fstream>
#include <SFML/System.hpp>
int main()
{
std::fstream fin("folder/file");
std::string aux = "";
sf::String sfmlAux;
while(getline(fin, aux)){
std::cout << aux << std::endl;
sfmlAux = aux;
aux = sfmlAux;
std::cout << aux << std::endl;
}
return 0;
}
the file contains
así
in UTF-8
The output of the program:
así
as
Thing is, using wstrings in windows works like a charm. I just change wstrings for strings (linux) and it doesn't work. Any ideas?