2.11.8. Convert file and directory name encoding

UTF-8 encoding is used for file and directory names on the hosting. If you copy files or directories with names encoded in CP-1251 (which is used in Windows) and their names contain Cyrillic characters, they must be recoded.

To convert the encoding, do the following:

  1. Connect to the hosting via SSH.
  2. Convert encoding:
    convmv -r -f cp1251 -t utf8 --notest ~/path/to/dir/

    The command consists of the following elements:

    • -r — change the encoding in all subdirectories.
    • -f — source encoding.
    • -t — target encoding (usually utf8).
    • –notest — change the encoding without manual confirmation for each file or directory.
    • ~/path/to/dir/ — path to the directory whose contents need to be processed. For example:
      • ~/path/to/dir/ — all files and subdirectories in the ~/path/to/dir/ directory.
      • ~/path/to/files/*.png — all files with the .png extension in the /path/to/files/ directory.
      • . — all files and subdirectories in the current directory (you can find out the path to the current directory using the pwd command).
  3. Wait for the command to complete.
Content

    (1)