Skip to content

Marshalling char16_t* or wchar_t* #1538

Description

@atlaste

Marshalling char16_t* and wchar_t* produces the wrong marshalling type.

Windows, MSVC++ to C#.

C++ signature:

void Log(const char16_t* str)

will produce:

void _LogDelegateHook(global::System.IntPtr __instance, [MarshalAs(UnmanagedType.LPUTF8Str)] string str)

Here, LPUTF8Str is wrong. char16_t is UTF16-LE. Tests confirm using LPWStr would fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions