Giorgi / DuckDB.NET

Bindings and ADO.NET Provider for DuckDB
https://duckdb.net
MIT License
338 stars 61 forks source link

Can't use unicode for connectionstring #196

Closed Cricle closed 2 weeks ago

Cricle commented 2 weeks ago
var path = Path.Combine(AppContext.BaseDirectory, "中文");
if (!Directory.Exists(path))
{
    Directory.CreateDirectory(path);
}
var connstr = new DuckDBConnectionStringBuilder();
connstr.DataSource = Path.Combine(path, "中文.db");
var db = new DuckDBConnection(connstr.ConnectionString);
db.Open();

will throw exception

DuckDB.NET.Data.DuckDBException:“DuckDBOpen failed: IO Error: Cannot open file "C:\Users\huaji\Desktop\c\npnp\bin\Debug\net8.0\����\����.db": ϵͳ�Ҳ���ָ����·����
”
Giorgi commented 2 weeks ago

Oh, the good old Unicode issue. The fix should be done in ConnectionManager.cs, do you want to send a PR?

Giorgi commented 1 week ago

@Cricle The fix is now live on NuGet.

Cricle commented 1 week ago

Thanks!