You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the `mode` parameter is set to <xref:System.IO.Compression.ZipArchiveMode.Read>, the stream must support reading. If the `mode` parameter is set to <xref:System.IO.Compression.ZipArchiveMode.Create>, the stream must support writing. If the `mode` parameter is set to <xref:System.IO.Compression.ZipArchiveMode.Update>, the stream must support reading, writing, and seeking.
2
2
3
-
When you open a zip archive file for reading and `entryNameEncoding` is set to `null`, entry names are decoded according to the following rules:
3
+
When you open a zip archive file for reading and `entryNameEncoding` is set to `null`, entry names and comments are decoded according to the following rules:
4
4
5
-
- When the language encoding flag (in the general-purpose bit flag of the local file header) is not set, the current system default code page is used to decode the entry name.
5
+
- When the language encoding flag (in the general-purpose bit flag of the local file header) is not set, the current system default code page is used to decode the entry name and comment.
6
6
7
-
- When the language encoding flag is set, UTF-8 is used to decode the entry name.
7
+
- When the language encoding flag is set, UTF-8 is used to decode the entry name and comment.
8
8
9
-
When you open a zip archive file for reading and `entryNameEncoding` is set to a value other than `null`, entry names are decoded according to the following rules:
9
+
When you open a zip archive file for reading and `entryNameEncoding` is set to a value other than `null`, entry names and comments are decoded according to the following rules:
10
10
11
-
- When the language encoding flag is not set, the specified `entryNameEncoding` is used to decode the entry name.
11
+
- When the language encoding flag is not set, the specified `entryNameEncoding` is used to decode the entry name and comment.
12
12
13
-
- When the language encoding flag is set, UTF-8 is used to decode the entry name.
13
+
- When the language encoding flag is set, UTF-8 is used to decode the entry name and comment.
14
14
15
-
When you write to archive files and `entryNameEncoding` is set to `null`, entry names are encoded according to the following rules:
15
+
When you write to archive files and `entryNameEncoding` is set to `null`, entry names and comments are encoded according to the following rules:
16
16
17
-
- For entry names that contain characters outside the ASCII range, the language encoding flag is set, and entry names are encoded by using UTF-8.
17
+
- For entry names and comments that contain characters outside the ASCII range, the language encoding flag is set, and entry names and comments are encoded by using UTF-8.
18
18
19
-
- For entry names that contain only ASCII characters, the language encoding flag is not set, and entry names are encoded by using the current system default code page.
19
+
- For entry names and comments that contain only ASCII characters, the language encoding flag is not set, and entry names and comments are encoded by using the current system default code page.
20
20
21
-
When you write to archive files and `entryNameEncoding` is set to a value other than `null`, the specified `entryNameEncoding` is used to encode the entry names into bytes. The language encoding flag (in the general-purpose bit flag of the local file header) is set only when the specified encoding is a UTF-8 encoding.
21
+
When you write to archive files and `entryNameEncoding` is set to a value other than `null`, the specified `entryNameEncoding` is used to encode the entry names and comments into bytes. The language encoding flag (in the general-purpose bit flag of the local file header) is set only when the specified encoding is a UTF-8 encoding.
Copy file name to clipboardExpand all lines: includes/remarks/System.IO.Compression/ZipFile/Open.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,22 +4,22 @@ When you set the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.
4
4
5
5
When you set the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.Update>, the archive is opened with <xref:System.IO.FileMode.OpenOrCreate?displayProperty=nameWithType> as the file mode value. If the archive exists, it is opened. The existing entries can be modified and new entries can be created. If the archive does not exist, a new archive is created; however, creating a zip archive in <xref:System.IO.Compression.ZipArchiveMode.Update> mode is not as efficient as creating it in <xref:System.IO.Compression.ZipArchiveMode.Create> mode.
6
6
7
-
When you open a zip archive file for reading and `entryNameEncoding` is set to `null`, entry names are decoded according to the following rules:
7
+
When you open a zip archive file for reading and `entryNameEncoding` is set to `null`, entry names and comments are decoded according to the following rules:
8
8
9
-
- When the language encoding flag (in the general-purpose bit flag of the local file header) is not set, the current system default code page is used to decode the entry name.
9
+
- When the language encoding flag (in the general-purpose bit flag of the local file header) is not set, the current system default code page is used to decode the entry name and comment.
10
10
11
-
- When the language encoding flag is set, UTF-8 is used to decode the entry name.
11
+
- When the language encoding flag is set, UTF-8 is used to decode the entry name and comment.
12
12
13
-
When you open a zip archive file for reading and `entryNameEncoding` is set to a value other than `null`, entry names are decoded according to the following rules:
13
+
When you open a zip archive file for reading and `entryNameEncoding` is set to a value other than `null`, entry names and comments are decoded according to the following rules:
14
14
15
-
- When the language encoding flag is not set, the specified `entryNameEncoding` is used to decode the entry name.
15
+
- When the language encoding flag is not set, the specified `entryNameEncoding` is used to decode the entry name and comment.
16
16
17
-
- When the language encoding flag is set, UTF-8 is used to decode the entry name.
17
+
- When the language encoding flag is set, UTF-8 is used to decode the entry name and comment.
18
18
19
-
When you write to archive files and `entryNameEncoding` is set to `null`, entry names are encoded according to the following rules:
19
+
When you write to archive files and `entryNameEncoding` is set to `null`, entry names and comments are encoded according to the following rules:
20
20
21
-
- For entry names that contain characters outside the ASCII range, the language encoding flag is set, and entry names are encoded by using UTF-8.
21
+
- For entry names or comments that contain characters outside the ASCII range, the language encoding flag is set, and entry names and comments are encoded by using UTF-8.
22
22
23
-
- For entry names that contain only ASCII characters, the language encoding flag is not set, and entry names are encoded by using the current system default code page.
23
+
- For entry names or comments that contain only ASCII characters, the language encoding flag is not set, and entry names and comments are encoded by using the current system default code page.
24
24
25
-
When you write to archive files and `entryNameEncoding` is set to a value other than `null`, the specified `entryNameEncoding` is used to encode the entry names into bytes. The language encoding flag (in the general-purpose bit flag of the local file header) is set only when the specified encoding is a UTF-8 encoding.
25
+
When you write to archive files and `entryNameEncoding` is set to a value other than `null`, the specified `entryNameEncoding` is used to encode the entry names and comments into bytes. The language encoding flag (in the general-purpose bit flag of the local file header) is set only when the specified encoding is a UTF-8 encoding.
Copy file name to clipboardExpand all lines: xml/System.IO.Compression/ZipArchive.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -276,7 +276,7 @@
276
276
<paramname="mode">One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries.</param>
277
277
<paramname="leaveOpen">
278
278
<seelangword="true" /> to leave the stream open after the <seecref="T:System.IO.Compression.ZipArchive" /> object is disposed; otherwise, <seelangword="false" />.</param>
279
-
<paramname="entryNameEncoding">The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names.</param>
279
+
<paramname="entryNameEncoding">The encoding to use when reading or writing entry names and comments in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names or comments.</param>
280
280
<summary>Initializes a new instance of the <seecref="T:System.IO.Compression.ZipArchive" /> class on the specified stream for the specified mode, uses the specified encoding for entry names, and optionally leaves the stream open.</summary>
0 commit comments