Laurent LA RIZZA
Laurent LA RIZZA

Reputation: 2965

What encoding are the LPCWSTR strings expected to be when calling the API?

I am trying to call the MessageBoxW Windows API function through the FFI of an esoteric language.

I have two strings to provide to the function. I may be wrong, but I understand that the LPCWSTR pointer is supposed to point to a null-terminated string of wchar_t (the width of which is compiler-specific)

What are the expected character set and encoding of these strings in the Win32 API?

Upvotes: 1

Views: 438

Answers (1)

David Heffernan
David Heffernan

Reputation: 612864

The required encoding is Unicode UTF-16LE.

Whilst the size of wchar_t is implementation defined, on Windows wchar_t is always 16 bit.

Upvotes: 2

Related Questions