Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marshalling char16_t* or wchar_t* #1538

Open
atlaste opened this issue Dec 2, 2020 · 4 comments
Open

Marshalling char16_t* or wchar_t* #1538

atlaste opened this issue Dec 2, 2020 · 4 comments

Comments

@atlaste
Copy link

atlaste commented Dec 2, 2020

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.

@tritao
Copy link
Collaborator

tritao commented Dec 2, 2020

We've had a pending PR that should help with this: #983

It just needs a bit of a push to get it over the line.

@josetr
Copy link
Contributor

josetr commented Dec 2, 2020

@tritao I already took care of this issue as far as I know.

const char16_t* TestCSharpString16(const char16_t* in, const char16_t** out)

The problem is that none of my contributions will be available for most people until we release a new nuget package to nuget.org.

@gitlsl
Copy link

gitlsl commented Dec 5, 2020

@josetr
When will you release the new version? It's been a long time since the last release

@josetr
Copy link
Contributor

josetr commented Dec 5, 2020

@josetr
When will you release the new version? It's been a long time since the last release

Soon. We had to fix some issues that came up after we upgraded everything to .NET Core to get this far and we also had to make some changes to support windows / linux / macos in a single package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants