Yep, it varies by platform. I’ve always been a Windows guy so I have a tendency to stick to “how it works on Windows” in my explanations unless the question is specifically about the difference in platforms. Old habits I suppose.
If you look at NameTypes.h
, it looks like support for constructing an FName with a UTF-8 literal was added in UE5.
For the sake of the OP’s question about the TEXT
macro, another way to think of it is that the string will either be converted to: L"My String"
or u8"My String"
or u"My String"
, depending on platform.
If you’re interested in venturing further down the rabbit hole of character encodings, this page has some good info.