Menu

#1060 ansi1251 wrong in "zip" archives

open-rejected
nobody
None
5
2024-06-11
2010-01-28
J.L.
No

ansi1251 display as ibm866
[Дикий помещик.htm] [─шъшщ яюьх∙шъ.htm]
all version now
zip created in win2003 eng with rus locale

Discussion

  • J.L.

    J.L. - 2010-01-28

    ansi1251 wrong in zip archives

     
  • Igor Pavlov

    Igor Pavlov - 2010-01-29
    • status: open --> open-rejected
     
  • Igor Pavlov

    Igor Pavlov - 2010-01-29

    What program did you use to create that zip archive?
    Note that zip in windows also doesn't show file name correctly.
    7-Zip keeps compatibility with zip from Windows.

     
  • J.L.

    J.L. - 2010-01-29

    I use zip.exe in this archive (in bat-file "zip.exe -9mSD %2 %3"). Total commander show true Дикий помещик.htm in zip (I don't know what plugin it use, 7.02a powerpack) and winrar 3.70 true too.

     
  • Igor Pavlov

    Igor Pavlov - 2010-01-29

    That zip.exe is not compatible with windows zip.
    So there were two ways for 7-Zip:
    1) zip.exe compatibilty
    2) windows zip compatibilty.
    7-Zip keeps compatibility with Zip in Windows.

     
  • J.L.

    J.L. - 2010-01-29

    But why winrar can show Дикий помещик.htm true ? :) Winrar can show file name true on all zip, so 3 way is....

     
  • Igor Pavlov

    Igor Pavlov - 2010-01-29

    There are some zip archives created with some old zip program (like zip.exe).
    There 2 ways to work with these archives:
    1) way of zip in windows.
    2) another way - maybe Winrar works that way.
    Since zip of windows is more popular than winRAR (95% of computers are windows and windows has internal zip), I selected to use way-1 of zip from windows for 7-zip.
    Note there is problem only in small number of zip archives created by some old software.

     
    • unxed

      unxed - 2024-05-20

      FYI: far2l file manager handles such archives just fine. It has some logic to choose if ansi or oem charset should be used.

      See zip.cpp. CP_ACP means Ansi Code Page, like 1251 etc. Relevant discussion.

          //  if (ZipHeader.PackOS==11 && ZipHeader.PackVer>20 && ZipHeader.PackVer<25)
          if (LITEND(ZipHeader.Flags) & 0x800) {  // Bit 11 - language encoding flag (EFS) - means filename&comment fields are UTF8
              ;
      
          } else if (ZipHeader.PackOS == 11 && ZipHeader.PackVer >= 20) {     // && ZipHeader.PackVer<25
              CPToUTF8(CP_ACP, Info->PathName);
              Info->Codepage = WINPORT(GetACP)();
      
          } else if (ZipHeader.PackOS == 11 || ZipHeader.PackOS == 0) {
              CPToUTF8(CP_OEMCP, Info->PathName);
              Info->Codepage = WINPORT(GetOEMCP)();
          }
      
       

      Last edit: unxed 2024-05-20
  • unxed

    unxed - 2024-06-07
     
  • unxed

    unxed - 2024-06-11

    Here is zip.exe that produces such files:
    https://github.com/tisaconundrum2/zip

    1DD3 CENTRAL HEADER #1 02014B50
    1DD7 Created Zip Spec 17 '2.3'
    1DD8 Created OS 0B 'MVS or NTFS'
    ...
    1E01 Filename 'Дикий помещик.htm'

    (in 1251 charset)

     

Log in to post a comment.