RealDocs

FName::GetPlainWIDEString

function Core Since 4.0
#include "UObject/NameTypes.h"
Access: public

Description

Copies the name string without its numeric suffix into a fixed-size wide character buffer. No allocation — the wide counterpart to GetPlainANSIString.

Caveats & Gotchas

  • Must only be used when the FName was originally stored as wide (UTF-16). Calling this on an ANSI FName produces a widened copy which is functionally correct but wastes the wider storage.
  • Like GetPlainANSIString, the buffer is always NAME_SIZE (1024) wide characters — null-terminated, no length returned.
  • WIDECHAR is wchar_t on Windows (2 bytes) but may be 4 bytes on some other platforms. Ensure the receiving code handles the platform-appropriate width.

Signature

CORE_API void GetPlainWIDEString(WIDECHAR(&WideName)[NAME_SIZE]) const

Parameters

Name Type Description Default
WideName WIDECHAR(&)[NAME_SIZE] Fixed-size wide char buffer to receive the name. Must be exactly NAME_SIZE characters.

Return Type

void

Example

Pass a wide name to a Win32 API that expects LPCWSTR C++
WIDECHAR WideBuf[NAME_SIZE];
MyFName.GetPlainWIDEString(WideBuf);
// WideBuf can be cast to LPCWSTR on Windows
SetWindowTextW(hWnd, (LPCWSTR)WideBuf);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.