CoreyKaylor / Lightning.NET

.NET library for LMDB key-value store
Other
397 stars 82 forks source link

Missing support for extended unicode path names #152

Closed bartwe closed 1 year ago

bartwe commented 2 years ago

Please use Marshal.StringToCoTaskMemUTF8 to pass path as an utf8 string instead of the letting the default ansi marshal happen in the dllimport.

CoreyKaylor commented 2 years 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

bartwe commented 2 years ago

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.

CoreyKaylor commented 1 year ago

I'm thinking some of these improvements might provide a reasonable path for this, correct?

https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-preview-7/#libraryimport-p-invoke-source-generator

bartwe commented 1 year ago

If utf8 is one of the options so it matches what the dll expects

CoreyKaylor commented 1 year ago

Yes, it is one of the options and seems to work well from my initial tests.

CoreyKaylor commented 1 year ago

https://github.com/CoreyKaylor/Lightning.NET/pull/158 fixes this issue on net7.0

CoreyKaylor commented 1 year ago

Closed by https://github.com/CoreyKaylor/Lightning.NET/pull/158

CoreyKaylor commented 1 year ago

Published version 0.15.0 that includes this change.