Skip to content

Pass binary filename to sqlite3_open #278

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

Closed

Conversation

greg-rychlewski
Copy link
Contributor

Closes #277

This looks like it's your issue since Elixir strings at UTF-8 encoded. But I have to admit I'm not sure why it was latin-1 before. So I might be stepping on a landmine without knowing it.

@greg-rychlewski
Copy link
Contributor Author

Ok I learned very quickly why it was ERL_NIF_LATIN1 before. It's because ERL_NIF-UTF8 is new. So instead of passing it as a charlist I pass it as a binary and then convert it to a proper null terminated string inside the nif.

Greg Rychlewski added 2 commits February 15, 2024 23:23
@greg-rychlewski
Copy link
Contributor Author

i'm pretty sure the failures are race conditions because they were not touched in this pr

@greg-rychlewski greg-rychlewski changed the title Use utf8 filename encoding when opening database in the nif Pass binary filename to sqlite3_open Feb 16, 2024
@greg-rychlewski
Copy link
Contributor Author

I guess it's not a race condition =(

@warmwaffles
Copy link
Member

I'll take a look at this later in the evening.

@warmwaffles
Copy link
Member

This may be an issue with how the filesystem represents utf8 characters in windows. I'm not a windows dev, but I think we'll need to dig in to wchar stuff for the filesystem. I suspect it's utf16.

@warmwaffles
Copy link
Member

@greg-rychlewski it's been a while, can you try re-running the CI. I can't see where to kick it off on my end.

@greg-rychlewski
Copy link
Contributor Author

@warmwaffles done

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

Successfully merging this pull request may close these issues.

Possible bug opening a database with an accent in path
2 participants