Try to create Upp::String basing on std::string like this:
String(fields[0]);
Actually, I tried that already: it compiles, but I still have gibberish in the db instead of the correct characters
Klugier wrote on Wed, 14 February 2018 21:20
IMO, you should use Core library to deal with text files. The easiest way is to use LoadFile(path):
Upp::String fileContent = Upp::LoadFile("PathToTextFile.txt");
// now you could use some powerfull functions from Core like Split;
Upp::Vector<String> fileContentLines = Upp::Split(fileContent, "\n");
for (const String& line : fileContentLines) {
// Loop over the line...
}
I will start from rewriting you code from standard library into Upp approch. This could save you problems with file encoding conversion.
Do you mean Upp can read data from an Ansi encoded file and convert it to utf-8 automatically? Currently I use stream from standard c++ library to read data from file.