I am trying to use a JSON library in my code. I am still grasping very basics as I am total rookie with C++. I have a trouble of converting FString to std::string. I did found this wiki page, but for some reason I am getting bunch of japanese(?) characters as the result.
I’ve made this function which is correctly recognized by the json library to do the conversion. However I am sensing there is something not quiet right about it.
void to_json(json& j, const FString& value) {
j = TCHAR_TO_UTF8(*value);
}
Here is the GitHub issue where I have been discussing this. Any idea what might be wrong please?
Edit
Actually I tried this without interference of the JSON lib and it behaves same way.
FString test = TEXT("MyTest");
std::string test2 = std::string(TCHAR_TO_UTF8(*test));
UE_LOG(LogTemp, Warning, TEXT("JSON %s"), test2.c_str());
Would produce following log statement: LogTemp:Warning: JSON 祍敔瑳