Zip archive - diacritics
Posted: 19 Sep 2025 13:35
Zip does not archive files with diacritics in their names. 1. Why? 2. How can this problem be solved?
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Code: Select all
/*
Title: 7-ZipXY
Summary: The most useful right-click options of 7-Zip, portablized for use in XY
Author: WirlyWirly
URL: https://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=24580
1 tab per submenu
DISPLAY|DATA (return value)|ICON|STATE
*/
$SEVENZIP = "C:\Program Files\7-Zip\7zG.exe";
$menu = <<<MENU
Extract to "*\"|$selected_items = ''; foreach($file, "<selitems ::>", "::") { $selected_items = lax($selected_items -ai!"$file") }; run lax("$SEVENZIP" x -o".\*\" "-spe" "-an" $selected_items)|
Extract here|$selected_items = ''; foreach($file, "<selitems ::>", "::") { $selected_items = lax($selected_items -ai!"$file") }; run lax("$SEVENZIP" x -o".\" "-an" $selected_items)|
-
Extract to "*\" in other pane|$selected_items = ''; foreach($file, "<selitems ::>", "::") { $selected_items = lax($selected_items -ai!"$file") }; run lax("$SEVENZIP" x -o"<path i>" "-spe" "-an" $selected_items)|
Extract to other pane|$selected_items = ''; foreach($file, "<selitems ::>", "::") { $selected_items = lax($selected_items -ai!"$file") }; run lax("$SEVENZIP" x -o"<path i>" "-an" $selected_items)|
-
Add to archive...|$selected_items = ''; foreach($file, "<selitems ::>", "::") { $selected_items = lax($selected_items -i!"$file") }; run lax("$SEVENZIP" a $selected_items -ad -saa -- "<curitempath>\<curbase>")|
MENU;
// Get X/Y position of a control
//$position = controlposition('TAB 1', 0);
//$x_pos = gettoken($position, 1, '|');
//$y_pos = gettoken($position, 2, '|');
// Display the context menu
//$command = popupnested($menu, $x_pos, $y_pos,,,,,|);
$command = popupnested($menu,,,,,,,|);
// Run the selected command or skip if it uses an id #
if ($command && !regexmatches($command, '^\#\d+$')) { load $command,, s; }
//if ($command) { load $command,, s; }
So, just get yourself a decent ZIP tool and zip away using the context menu. That's what we all do. XY's zip commands are just there for the rare case that no zip tool is available on a system. A fallback to Windows's built-in and outdated "Compressed Folders" tool. Better than nothing.Windows's built-in "Compressed Folders" tool has a known issue with Unicode filenames because it uses a legacy encoding system (like CP437) that doesn't properly support characters from other languages or alphabets. To create ZIP files that correctly handle Unicode characters, you need to use a dedicated third-party ZIP tool like 7-Zip or WinZip, which specifically support Unicode in their ZIP archives.
I suppose that means, "Thank you for trying to help by providing me with all the necessary information to understand the nature of my problem and showing me several ways to solve it!"Petru wrote:Adios ! It's a toxic atmosphere here