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

[Bug]: #160

Open
1 task done
JackieS7 opened this issue Jul 28, 2023 · 6 comments
Open
1 task done

[Bug]: #160

JackieS7 opened this issue Jul 28, 2023 · 6 comments
Assignees
Labels

Comments

@JackieS7
Copy link

bit7z version

4.0.x RC

Compilation options

No response

7-zip version

v22.01

7-zip shared library used

7z.dll / 7z.so

Compilers

MSVC

Compiler versions

No response

Architecture

x86_64

Operating system

Windows

Operating system versions

10

Bug description

Why I can create zip if in the files names have names just like this diseño grafico.txt?

Steps to reproduce

No response

Expected behavior

No response

Relevant compilation output

No response

Code of Conduct

@rikyoz
Copy link
Owner

rikyoz commented Jul 28, 2023

Hi!
Could you give me more details on the error you are experiencing?
What exception message is the library throwing, if any?
Thank you!

@JackieS7
Copy link
Author

dont support utf-8 in string? How i can do it?

@JackieS7
Copy link
Author

`#include <bit7z/bitfilecompressor.hpp>

#pragma comment(lib, "bit7z.lib")

int main() {
try {
using namespace bit7z;

    Bit7zLibrary lib{ "7z.dll" };

    BitFileCompressor compressor{ lib, BitFormat::Zip };
    std::string sourceFolderPath = (std::filesystem::path(std::getenv("USERPROFILE")) / "myfolder").string();
    std::string outputArchiveName = (std::filesystem::path(std::getenv("USERPROFILE")) / "out.zip").string();
    compressor.setPassword("my_password"); 
    compressor.compressDirectory(sourceFolderPath, outputArchiveName);


    return 0;
}
catch (const bit7z::BitException& ex) {
    std::cerr << "Error during compression: " << ex.what() << std::endl;
    return 1;
}`

in the "myfolder" dir I have file with name "diseño grafico.txt". If I remove that file all is Ok, but if it exist I recieve exception error 0x00007FFE9084CF19 Microsoft C++: std::system_error 0x000000D609CFBC48.

@rikyoz
Copy link
Owner

rikyoz commented Jul 29, 2023

Thank you for the details!
I tried to replicate your issue with the same settings and the same code; unfortunately, I wasn't able to reproduce it, the code works fine.
Bit7z should support UTF-8 file names in Zip files without problems.

exception error 0x00007FFE9084CF19 Microsoft C++: std::system_error 0x000000D609CFBC48

Is this an error printed in the catch block, or is it an uncaught exception?
In any case, what's the exception's what() message?

@rikyoz
Copy link
Owner

rikyoz commented Aug 4, 2023

I have done numerous tests and, unfortunately, have not yet been able to replicate the problem.
Specifically, in a virtual machine with a fresh installation of Windows 10, I tested the exact same code you provided, compiling it with all the MSVC versions supported by bit7z (2015, 2017, 2019, and 2022).
The program never had any problems creating the archive:

image
Screenshot of my test with MSVC 2015.

If you're still experiencing the same issue, please provide more details like, for example, the what() message of the thrown exception, what version of MSVC and what compiler flags you are using, and what code page your program runs on.

@rikyoz
Copy link
Owner

rikyoz commented Oct 3, 2023

Hi!
With the latest stable version v4.0.1, I improved the handling of UTF-8 paths, fixing also some issues that might be related to your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants