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

MultiArc/ZIP [feature] - if ZIP has both 1-byte and UTF-8 filename always force using UTF-8 #2404

Open
akruphi opened this issue Sep 29, 2024 · 1 comment

Comments

@akruphi
Copy link
Contributor

akruphi commented Sep 29, 2024

Согласно жалобе в телеграм-чате
https://t.me/far2l_ru/28667
https://t.me/far2l_ru/28673
встречаются ZIP архивы, где одновременно имена файлов и в однобайтовой кодировке и в UTF-8.
При этом на панели multiarc выводит имена правильно (похоже беря из UTF-8), а при распаковке far2l пытается принудительно использовать ключ -cs=CP437 (или подобный в зависимости от внутренних OEM/ANSI far2l), что в случае если внутренние OEM/ANSI far2l не совпадают с однобайтной кодировкой архива приводит к невозможности восстановить имена файлов.

@unxed похоже при наличии UTF-8 имени файла внутри ZIP стоит далее при обработке всегда принудительно использовать UTF-8.

@unxed
Copy link
Contributor

unxed commented Sep 29, 2024

Problematic archive sample:
https://t.me/itbook_library/2459
(part 3, for example)

Fix:

diff --git a/multiarc/src/arccmd.cpp b/multiarc/src/arccmd.cpp
index 69b3993b..57080021 100644
--- a/multiarc/src/arccmd.cpp
+++ b/multiarc/src/arccmd.cpp
@@ -312,8 +312,10 @@ int ArcCommand::ReplaceVar(std::string &Command)
           break;
         }
       }
+      /*
       if (Command.empty() && DefaultCodepage > 0)
         Command = StrPrintf("CP%u", DefaultCodepage);
+      */
 
       break;
 

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

No branches or pull requests

2 participants