-scs (Set charset for list files) switch
Sets charset for list files.
Syntax
-scs{UTF-8 | UTF-16LE | UTF-16BE | WIN | DOS | {id} }
Default charset is UTF-8.
Notes: The list file in Unicode charset can start with the BOM (byte order mark) character (U+FEFF).
In that case 7-Zip checks that encoding of BOM corresponds to encoding
specified with this switch (for UTF-16LE and UTF-16BE).
Examples
7z a archive.7z @listfile.txt -scsWIN
compresses files from listfile.txt list, that contains
list of files in default character set of Windows.
7z a archive.7z @listfile.txt -scs1251
compresses files from listfile.txt list, that contains
list of files in 1251 (Cyrillic Windows) codepage.
Commands that can be used with this switch
a (Add) ,
u (Update)
Notes from this site
Not part of the 7-Zip manual. Written by this site; examples checked with 7-Zip 26.04.
Does -scs change archive names or console output?
-scs changes only how 7-Zip reads the @listfile you pass on the command line. It does not change the names stored in the archive, and it does not change console output; for console output use -scc .
Quick examples
Use 7z on Windows and 7zz (the official console binary) on Linux/macOS.
7z a archive.7z @list.txt
7z a archive.7z @list.txt -scsUTF-16LE
7z a archive.7z @list.txt -scsUTF-16BE
iconv -f UTF-16LE -t UTF-8 list.txt > list8.txt
file list.txt
Line 1 needs no switch if list.txt is UTF-8, the default (-scsUTF-8 spells it out). A UTF-8 file with a BOM is also fine, and names such as café.txt and файл.txt work.
Line 2 is for a UTF-16 little-endian list; line 3 for big-endian. Without the switch, 7-Zip stops with "Incorrect item in listfile. Check charset encoding and -scs switch." This happens even when the file has a BOM.
If the BOM and the switch disagree (a little-endian file read with -scsUTF-16BE), the names come out garbled.
Line 4 converts a UTF-16 list to UTF-8 on Linux/macOS. On Windows the converting step is not needed: keep the list as it is and add the -scs switch.
Line 5 tells you the encoding on Linux/macOS: a UTF-16 list with BOM shows as "Unicode text, UTF-16, little-endian text"; without a BOM it shows only "data".
Common mistakes
Saving the list as "Unicode" or UTF-16 and forgetting the switch. Many Windows tools and shell redirections write UTF-16, so check the encoding in your editor.
Using -scsWIN, -scsDOS or a code page number such as -scs1251 on Linux/macOS; these are Windows code pages, so save the list as UTF-8 instead.
Related pages
-scc , List files , a (Add) , u (Update)