FTCHARToUTF8

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

Windows
MacOS
Linux

Type

typedef TStringConversion< FTCHARToUTF8_Convert > FTCHARToUTF8

Remarks

NOTE: 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.

NOTE: 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!!!

References

Module

Core

Header

Runtime/Core/Public/Containers/StringConv.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback