Hi,
Im usin the following code to read a text file into an FString:
FString ACustomController::ImportFromFile(FString AFilename)
{
FString directory = FPaths::Combine(FPaths::GameContentDir(), "Data");
FString result;
return directory; // just testing ...
IPlatformFile& file = FPlatformFileManager::Get().GetPlatformFile();
if (file.CreateDirectory(*directory)) {
FString myFile = directory + "/" + AFilename;
FFileHelper::LoadFileToString(result, *myFile);
}
return result;
}
When testing the code I foynd that weird folders with chinese characters were created within my content folder.
After just putting out the directory string, I see this:
Of course that explains the weird folder being created. But what is causing it and how to “sanitize” the string propertly?
What am I missing here?
Any help is appreciated
Cheers,
Klaus