CoreyKaylor / Lightning.NET

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

[Windows/.NET 6.0] Can't open Environments where the Path contains special characters #162

Closed Sonix closed 1 year ago

Sonix commented 1 year ago

OS: Windows 10 Pro .NET Runtime: 6.0.315

Description

Trying to open an Environment in a Path with special characters like 'ß' fails on Windows.

Testcase

    public void CanOpenEnvironmentWithSpecialCharacters()
    {
        _env = new LightningEnvironment(Path.Combine(Path.GetTempPath(), "Testß"));

        _env.Open();
    }

Workaround / Fix

Manually convert the string to a bayte[9 before calling the native DLL works, like this:

var bytes = Encoding.UTF8.GetBytes(path);

I'll open a Pull Request with the change that works for me in a minute.

Sonix commented 1 year ago

@CoreyKaylor Hi, is there a possibility for a bugfix release from your side which contains this change? I can also work with a local fork until your next regular release but if one does happen anyway I'd save myself the extra effort :) Thanks!

CoreyKaylor commented 1 year ago

I'll try and get something out this weekend. It's a busy week for me at work.

Sonix commented 1 year ago

Cool, thanks alot! No pressure though, its not that urgent :)