Fix garbled Chinese filenames when importing ZIP files. (#14633)

* Fix garbled Chinese filenames when importing ZIP files.

* fix: avoid repeated ZIP path CRC calculation
This commit is contained in:
anjis
2026-07-08 20:24:55 +08:00
committed by GitHub
parent 12b63ebe36
commit cab62070b5
4 changed files with 42 additions and 19 deletions

View File

@@ -13923,17 +13923,9 @@ bool Plater::preview_zip_archive(const boost::filesystem::path& archive_path)
if (mz_zip_reader_file_stat(&archive, i, &stat)) {
if (size != stat.m_uncomp_size) // size must fit
continue;
wxString wname = boost::nowide::widen(stat.m_filename);
std::string name = into_u8(wname);
std::string name = Slic3r::decode_archive_entry_path(&archive, stat);
fs::path archive_path(name);
std::string extra(1024, 0);
size_t extra_size = mz_zip_reader_get_filename_from_extra(&archive, i, extra.data(), extra.size());
if (extra_size > 0) {
archive_path = fs::path(extra.substr(0, extra_size));
name = archive_path.string();
}
if (archive_path.empty())
continue;
if (path != archive_path)