Comments (6)
On wich operating system are you using libzip?
Can you trace through zip_open to see where the error occurs?
from libzip.
Hey, thanks for your fast reply.
I am using Windows 7 Professional x64 with libzip 1.5.1.
This is the path that gets passed to the function:
C:\exchange\OfflineDatensätze\bP Rapid\NOK\EthSpy Fehler\D0001Z001\offlineDataset.zip;
The error happens in zip_source_win32utf8.c (line 62):
/* Convert fname from UTF-8 to Windows-friendly UTF-16. */ size = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, fname, -1, NULL, 0); if (size == 0) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; }
Seems like the function MultiByteToWideChar returns zero, but I can´t imagine why.
from libzip.
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.
from libzip.
Okay, I have not much experience with encodings, here is the part of the code, where I try to open the archive:
c_archive = zip_open(c_fileName.c_str(), ZIP_RDONLY, &error);
c_fileName is just a std::string, I get it from a file choosing dialog.
Can this be the problem?
Can you tell me how to convert it to utf8?
from libzip.
Sorry, I'm not a Windows developer. Examine c_fileName to see wether it is in UTF-8.
from libzip.
It seems like c_fileName is Latin(ISO-8859-1) encoded.
I converted it to UTF8 now, and its working with umlauts.
Thank you for your great support!
from libzip.
Related Issues (20)
- Unfriendly for decompressing windos zip, zip_ Open error=21 HOT 2
- Incorrect Progress Progression State - With Fix HOT 1
- Does libzip support "Central Directory Encryption"? HOT 6
- Add a different error code for truncated ZIPs HOT 3
- zip_close failed cause filesystem handle to leak. HOT 3
- How to save or socket an archive from memory? HOT 3
- ld: library 'zip' not found HOT 2
- libzip::zip doesn't exist HOT 2
- Make CMake options consistent HOT 2
- No rule to make target 'zlib.h', needed by 'lib/libzip.dll' HOT 7
- ZIP_CM_SHRINK and ZIP_CM_IMPLODE give unsupported compression method error HOT 1
- Error when use with CPM (cmake package manager) HOT 1
- ZIP_ER_INCONS error (Zip archive inconsistent) on an apparently valid ZIP archive HOT 2
- error while loading shared libraries from /usr/local/lib, dir not in path under Linux Mint HOT 1
- 4 GB limit? HOT 1
- Functionality for creation of split-volume zip files based on individual byte ranges of complete file HOT 3
- Creating ZIP archives is not properly handling wchar_t on Windows 11/x64.
- Crash with illegal instruction under Windows 11 x64 ARM virtualization HOT 2
- Fix documentation of `zip_source_win32handle` HOT 1
- Enhance documentation of `zip_source_zip_file` and `zip_source_zip`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libzip.