How do I read and write to the Language key in MyGameEngine.ini?

Possibly making progress. New compile error. I wish I had studied C++ before now.



void UObject::execSetLanguage(FFrame& Stack, RESULT_DECL)
{
   P_GET_STR_REF(A);
    P_GET_UBOOL(B);
    P_FINISH;
    SetLanguage(*A, B);
}


What I think is happening is that execSetLanguage is the function that I’m supposed to use to connect UnrealScript SetLanguage to C++ SetLanguage. The problem is that UnrealScript sends a string (edit: which automatically gets parsed into an FString, I think) and C++ wants a tchar. There are a bunch of macros in UnScriptMacros.h for getting the necessary variables, but I don’t see anything that converts an FString to a tchar. I just Googled how to do that, and it looks like a straightforward conversion, but I would imagine that UE3 must already have a way of doing that already. [Edit: I was looking for how to convert strings. UE3 FStrings are something completely different.]

And I hope I’m OK with the NDA so far. I haven’t copied any existing UE3 code here. This is all just stuff I’ve added while trying to figure this out.

Edit: I just updated the code. It works. I can confirm that the language changed when I call GetLanguage. I still need to figure out how to save the setting though.