Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-59005

Directory activity: wrong file encoding after extraction of zip file with Cyrillic file names

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.4, 3.2, 3.3
    • Fix Version/s: 3.2.4, 3.3.1
    • Component/s: Resource
    • Labels:
    • Testing Instructions:
      Hide
      1. Log in as admin.
      2. Install Russian (ru) language pack.
      3. Set the language to Russian.
      4. Go to an existing course or create a new one.
      5. Turn editing mode on and click to add an activity or resource
      6. Select Folder and upload attached zip file (subfolder.zip), but do not save yet.
      7. Click on the zip inside the file picker, a pop up will show.
      8. Click on the button on the righ Распаковать ZIP-архив.
      9. Note the file got extraced a new folder has been created.
      10. Click on the folder (subfolder).
      11. Make sure the correct filename is displayed проверочный файл.txt
        • The incorrect filename is {{Їа®ўҐа®з­л© д ©«.txt}}
      Show
      Log in as admin. Install Russian (ru) language pack. Set the language to Russian. Go to an existing course or create a new one. Turn editing mode on and click to add an activity or resource Select Folder and upload attached zip file (subfolder.zip), but do not save yet . Click on the zip inside the file picker, a pop up will show. Click on the button on the righ Распаковать ZIP-архив . Note the file got extraced a new folder has been created. Click on the folder (subfolder). Make sure the correct filename is displayed проверочный файл.txt The incorrect filename is {{Їа®ўҐа®з­л© д ©«.txt}}
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59005-master

      Description

      Reproducible on 3.1.4 (release) and 3.4 (development). Probably affects all other versions.

      Steps to reproduce:

      • Install Russian language pack (one for 3.4 was not yet available at the time of submitting this issue so I used one from 3.1.4 for both versions).
      • Switch Moodle language to Russian. It is required because user language is used in a last resort technique of guessing the encoding of file names in the zip archive.
      • Create a course with directory activity and start editing its files.
      • Upload an attached zip archive to the folder. This archive contains the file named in Russian, using Cyrillic characters. Alternatively, you can create zip file on Russian version of Windows (one that uses CP-1251 as default code page) using Windows Explorer "Compressed (zip) Folders" feature. Similar archive could be created using 7zip on Windows and even on Linux using 7zip + Wine (Russian language and CP-1251 encoding are required here too).
      • Click on the uploaded archive in the Moodle UI and press unzip button.

      What I expected:

      • An unpacked directory contains files with the same names I saw when I added them to archive.

      What actually happens:

      • An unpacked directory contains files, but Russian file name is displayed in wrong encoding. The screenshots are attached.

      The similar issue for Hebrew is MDL-35795.

      The proposed fix:
      https://github.com/vvzh/moodle/compare/590292d...MDL-59005-cyrillic-zip-fix

        Attachments

        1. moodle-zip-actual.png
          moodle-zip-actual.png
          53 kB
        2. moodle-zip-expected.png
          moodle-zip-expected.png
          53 kB
        3. subfolder.zip
          0.5 kB

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Jul/17