Skip to content
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

Non English letters in File paths will fail on Windows #18

Open
gabrielaexile opened this issue Jul 29, 2021 · 2 comments
Open

Non English letters in File paths will fail on Windows #18

gabrielaexile opened this issue Jul 29, 2021 · 2 comments
Assignees
Labels
bug Something isn't working platform-issue Issue is specific to an OS or desktop priority-low
Milestone

Comments

@gabrielaexile
Copy link

Non English letters will fail in File paths for Windows _open cannot carry UTF8 on Windows.

Only solution I know is to use:

#ifdef _WIN32
if ((fd = _wopen((const wchar_t*)filename, O_RDONLY | O_BINARY)) < 0)
#else
if ((fd = open(filename, O_RDONLY | O_BINARY)) < 0)
#endif

Or alternative if you want to keep your API using UTF8 then take it in as UTF8 and convert to UTF16 before calling _wopen.

@gabrielaexile
Copy link
Author

Example file path would be like if Windows user name is Þórunn then you cannot save the PDF in My Documents.

@michaelrsweet
Copy link
Owner

Sigh, I hate Windows... For now I will just document the issue until I can write a proper wrapper function.

@michaelrsweet michaelrsweet self-assigned this Jul 29, 2021
@michaelrsweet michaelrsweet added bug Something isn't working platform-issue Issue is specific to an OS or desktop priority-low labels Jul 29, 2021
@michaelrsweet michaelrsweet added this to the Future milestone Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform-issue Issue is specific to an OS or desktop priority-low
Projects
None yet
Development

No branches or pull requests

2 participants