-
Notifications
You must be signed in to change notification settings - Fork 263
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
zip_open fails with error 18 when file path contains umlauts #68
Comments
On wich operating system are you using libzip? Can you trace through zip_open to see where the error occurs? |
Hey, thanks for your fast reply. This is the path that gets passed to the function:
The error happens in zip_source_win32utf8.c (line 62): Seems like the function MultiByteToWideChar returns zero, but I can´t imagine why. |
Maybe the file name is not encoded in UTF-8, but some other encoding like ISO-8859-1. If so, you will have to convert it to UTF-8 before passing it to libzip. |
Okay, I have not much experience with encodings, here is the part of the code, where I try to open the archive:
c_fileName is just a std::string, I get it from a file choosing dialog. |
Sorry, I'm not a Windows developer. Examine c_fileName to see wether it is in UTF-8. |
It seems like c_fileName is Latin(ISO-8859-1) encoded. |
Dear authors of libzip,
first of all I want to thank you for your great zip library.
It was easy to implement and is much better in usage and performance than wxZip.
I write you because I have found a small issue.
When I try to open zip files using the zip_open function I get an error in some cases.
The function returns error code 18 when I try to open a zip with a file path containing umlauts.
#define ZIP_ER_INVAL 18 /* N Invalid argument */
Can you please tell me what I can do, to fix this issue?
I cannot prevent my users from opening zips where the file path contains umlauts.
Yours Sincerely
The text was updated successfully, but these errors were encountered: