Skip to content

Commit b2a4028

Browse files
authored
Update ZipArchive.xml, ZipFile.xml (#10193)
Changed references to entryNameEncoding to clarify that it changes the encoding and decoding of both entry names and comments.
1 parent da89a62 commit b2a4028

File tree

4 files changed

+44
-44
lines changed

4 files changed

+44
-44
lines changed
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
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.
22

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:
44

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.
66

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.
88

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:
1010

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.
1212

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.
1414

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:
1616

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.
1818

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.
2020

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.

includes/remarks/System.IO.Compression/ZipFile/Open.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ When you set the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.
44

55
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.
66

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:
88

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.
1010

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.
1212

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:
1414

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.
1616

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.
1818

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:
2020

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.
2222

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.
2424

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.

xml/System.IO.Compression/ZipArchive.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
<param name="mode">One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries.</param>
277277
<param name="leaveOpen">
278278
<see langword="true" /> to leave the stream open after the <see cref="T:System.IO.Compression.ZipArchive" /> object is disposed; otherwise, <see langword="false" />.</param>
279-
<param name="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+
<param name="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>
280280
<summary>Initializes a new instance of the <see cref="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>
281281
<remarks>
282282
<format type="text/markdown"><![CDATA[

0 commit comments

Comments
 (0)