Closed bartwe closed 1 year ago
I'm assuming that it might be more ideal to Use the technique described here instead? Or am I missing something?
https://stackoverflow.com/questions/17808003/dllimport-ansi-vs-unicode
That would require changes to the native side to accept the utf16 widechar string when passing unicode. This would still require changes on the native side but would work correctly by default on linux.
I'm thinking some of these improvements might provide a reasonable path for this, correct?
If utf8 is one of the options so it matches what the dll expects
Yes, it is one of the options and seems to work well from my initial tests.
https://github.com/CoreyKaylor/Lightning.NET/pull/158 fixes this issue on net7.0
Published version 0.15.0 that includes this change.
Please use Marshal.StringToCoTaskMemUTF8 to pass path as an utf8 string instead of the letting the default ansi marshal happen in the dllimport.