- <param name="entryNameEncoding"><para>The encoding to use when reading or writing entry names and comments in this ZipArchive.</para><para>/// <para>NOTE: Specifying this parameter to values other than <see langword="null" /> is discouraged.</para><para>However, this may be necessary for interoperability with ZIP archive tools and libraries that do not correctly support UTF-8 encoding for entry names.<br /> This value is used as follows:</para><para> <strong>Reading (opening) ZIP archive files:</strong> </para><para>If <c>entryNameEncoding</c> is not specified (<c>== null</c>):</para><list> <item>For entries where the language encoding flag (EFS) in the general purpose bit flag of the local file header is <em>not</em> set, use the current system default code page (<c>Encoding.Default</c>) in order to decode the entry name and comment.</item> <item>For entries where the language encoding flag (EFS) in the general purpose bit flag of the local file header <em>is</em> set, use UTF-8 (<c>Encoding.UTF8</c>) in order to decode the entry name and comment.</item> </list><para>If <c>entryNameEncoding</c> is specified (<c>!= null</c>):</para><list> <item>For entries where the language encoding flag (EFS) in the general purpose bit flag of the local file header is <em>not</em> set, use the specified <c>entryNameEncoding</c> in order to decode the entry name and comment.</item> <item>For entries where the language encoding flag (EFS) in the general purpose bit flag of the local file header <em>is</em> set, use UTF-8 (<c>Encoding.UTF8</c>) in order to decode the entry name and comment.</item> </list><para> <strong>Writing (saving) ZIP archive files:</strong> </para><para>If <c>entryNameEncoding</c> is not specified (<c>== null</c>):</para><list> <item>For entry names and comments that contain characters outside the ASCII range, the language encoding flag (EFS) will be set in the general purpose bit flag of the local file header, and UTF-8 (<c>Encoding.UTF8</c>) will be used in order to encode the entry name and comment into bytes.</item> <item>For entry names and comments that do not contain characters outside the ASCII range, the language encoding flag (EFS) will not be set in the general purpose bit flag of the local file header, and the current system default code page (<c>Encoding.Default</c>) will be used to encode the entry names and comments into bytes.</item> </list><para>If <c>entryNameEncoding</c> is specified (<c>!= null</c>):</para><list> <item>The specified <c>entryNameEncoding</c> will always be used to encode the entry names and comments into bytes.</para><para>The language encoding flag (EFS) in the general purpose bit flag of the local file header will be set if and only if the specified <c>entryNameEncoding</c> is a UTF-8 encoding.</item> </list><para>Note that Unicode encodings other than UTF-8 may not be currently used for the <c>entryNameEncoding</c>, otherwise an <see cref="T:System.ArgumentException" /> is thrown.</para></param>
0 commit comments