FTCHARToUTF8

These should be replaced with StringCasts when FPlatformString starts to know about UTF-8.

Choose your operating system:

Windows

macOS

Linux

Type

typedef TStringConversion< FTCHARToUTF8_Convert > FTCHARToUTF8

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Containers/StringConv.h

Include

#include "Containers/StringConv.h"

Remarks

The objects these macros declare have very short lifetimes. They are meant to be used as parameters to functions. You cannot assign a variable to the contents of the converted string as the object will go out of scope and the string released.

The parameter you pass in MUST be a proper string, as the parameter is typecast to a pointer. If you pass in a char, not char* it will compile and then crash at runtime. Usage: SomeApi(TCHAR_TO_ANSI(SomeUnicodeString));

const char* SomePointer = TCHAR_TO_ANSI(SomeUnicodeString); <--- Bad!!!