Skip to content

Commit bb4295b

Browse files
authored
Add missing Encoding APIs docs (#4821)
1 parent 59b16df commit bb4295b

File tree

4 files changed

+88
-77
lines changed

4 files changed

+88
-77
lines changed

xml/System.Text/CodePagesEncodingProvider.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ The .NET Framework supports a large number of character encodings and code pages
192192
</ReturnValue>
193193
<Parameters />
194194
<Docs>
195-
<summary>To be added.</summary>
196-
<returns>To be added.</returns>
195+
<summary>Returns an array that contains all the encodings that are supported by the <see cref="T:System.Text.CodePagesEncodingProvider" />.</summary>
196+
<returns>An array that contains all the supported encodings.</returns>
197197
<remarks>To be added.</remarks>
198198
</Docs>
199199
</Member>

xml/System.Text/Encoding.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ The following table lists the encodings supported by .NET. It lists each encodin
271271
- Change to an application-specific behavior through use of the <xref:System.Text.EncoderFallback> and <xref:System.Text.DecoderFallback> classes with the U+FFFD Unicode replacement character.
272272
273273
You should throw an exception on any data stream error. An app either uses a "throwonerror" flag when applicable or uses the <xref:System.Text.EncoderExceptionFallback> and <xref:System.Text.DecoderExceptionFallback> classes. Best fit fallback is often not recommended because it can cause data loss or confusion and is slower than simple character replacements. For ANSI encodings, the best fit behavior is the default.
274-
274+
275275
## Examples
276276
The following example converts a string from one encoding to another.
277277
@@ -588,7 +588,7 @@ The following example demonstrates the effect of the ASCII encoding on character
588588
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.BigEndianUnicode/VB/bigendianunicode1.vb" id="Snippet2":::
589589
590590
The returned <xref:System.Text.UnicodeEncoding> object has <xref:System.Text.Encoding.BodyName%2A>, <xref:System.Text.Encoding.HeaderName%2A>, and <xref:System.Text.Encoding.WebName%2A> properties, which yield the name "unicodeFFFE". Although the UTF-16 big endian byte order mark is hexadecimal FEFF, the name "unicodeFFFE" was chosen because the byte order mark appears as hexadecimal FFFE on little endian Windows computers.
591-
591+
592592
## Examples
593593
The following example reads a text file with a UTF-16 encoding using the big endian byte order.
594594
@@ -2497,7 +2497,7 @@ On .NET Core, the <xref:System.Text.Encoding.Default%2A> property always returns
24972497
24982498
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetBytes_String/CPP/getbytes_string.cpp" id="Snippet1":::
24992499
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetBytes_String/CS/getbytes_string.cs" interactive="try-dotnet" id="Snippet1":::
2500-
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetBytes_String/VB/getbytes_string.vb" id="Snippet1":::
2500+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetBytes_String/VB/getbytes_string.vb" id="Snippet1":::
25012501
25022502
]]></format>
25032503
</remarks>
@@ -2951,7 +2951,7 @@ On .NET Core, the <xref:System.Text.Encoding.Default%2A> property always returns
29512951
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CPP/getchars.cpp" id="Snippet1":::
29522952
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/CS/getchars.cs" interactive="try-dotnet" id="Snippet1":::
29532953
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.Encoding.GetChars/VB/getchars.vb" id="Snippet1":::
2954-
2954+
29552955
]]></format>
29562956
</remarks>
29572957
<exception cref="T:System.ArgumentNullException">
@@ -3728,7 +3728,7 @@ In .NET 5.0 and later versions, the code page name `utf-7` is not supported.
37283728
## Remarks
37293729
37303730
> [!NOTE]
3731-
> - Some unsupported code pages cause the exception <xref:System.ArgumentException> to be thrown, whereas others cause <xref:System.NotSupportedException>. Therefore, your code must catch all exceptions indicated in the Exceptions section.
3731+
> - Some unsupported code pages cause the exception <xref:System.ArgumentException> to be thrown, whereas others cause <xref:System.NotSupportedException>. Therefore, your code must catch all exceptions indicated in the Exceptions section.
37323732
> - In .NET 5.0 and later versions, the code page identifier `65000`, which represents UTF-7, is not supported.
37333733
37343734
In .NET Framework, the <xref:System.Text.Encoding.GetEncoding%2A> method relies on the underlying platform to support most code pages. However, .NET Framework natively supports some encodings. For a list of code pages, see [List of encodings](/dotnet/api/system.text.encoding#list-of-encodings). In .NET Core, the <xref:System.Text.Encoding.GetEncoding%2A> method returns the encodings natively supported by .NET Core. On both .NET implementations, you can call the <xref:System.Text.Encoding.GetEncodings%2A> method to get an array of <xref:System.Text.EncodingInfo> objects that contains information about all available encodings.
@@ -3902,7 +3902,9 @@ In .NET 5.0 and later versions, the code page name `utf-7` is not supported.
39023902
This method returns a list of supported encodings, uniquely distinguished by code page. For a table that lists the supported encodings, see <xref:System.Text.Encoding>.
39033903
39043904
> [!NOTE]
3905-
> The list of supported encodings returned by the <xref:System.Text.Encoding.GetEncodings%2A> method does not include any additional encodings made available by any <xref:System.Text.EncodingProvider> implementations that were registered by calls to the <xref:System.Text.Encoding.RegisterProvider%2A> method.
3905+
> In .NET 5.0 and later versions, the list of supported encodings that <xref:System.Text.Encoding.GetEncodings%2A> returns includes any additional encodings made available by any <xref:System.Text.EncodingProvider> implementations that were registered by calling <xref:System.Text.Encoding.RegisterProvider%2A>.
3906+
>
3907+
> In .NET Framework and .NET Core, the returned list of supported encodings *does not* include these additional encodings.
39063908
39073909
On .NET Framework, encodings 50220 and 50222 are both associated with the name "iso-2022-jp", but they are not identical. Encoding 50220 converts half-width Katakana characters to full-width Katakana characters, whereas encoding 50222 uses a shift-in/shift-out sequence to encode half-width Katakana characters. The display name for encoding 50222 is "Japanese (JIS-Allow 1 byte Kana - SO/SI)" to distinguish it from encoding 50220, which has the display name "Japanese (JIS)".
39083910

xml/System.Text/EncodingExtensions.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</Base>
1515
<Interfaces />
1616
<Docs>
17-
<summary>To be added.</summary>
17+
<summary>Provides extension methods for the encoding types, such as <see cref="T:System.Text.Encoding" />, <see cref="T:System.Text.Encoder" />, and <see cref="T:System.Text.Decoder" />.</summary>
1818
<remarks>To be added.</remarks>
1919
</Docs>
2020
<Members>
@@ -322,7 +322,7 @@
322322
<param name="chars">The sequence to encode to bytes.</param>
323323
<param name="writer">The buffer to which the encoded bytes will be written.</param>
324324
<summary>Encodes the specified <see cref="T:System.ReadOnlySpan`1" /> to <see langword="byte" />s using the specified <see cref="T:System.Text.Encoding" /> and writes the result to <paramref name="writer" />.</summary>
325-
<returns>To be added.</returns>
325+
<returns>The number of bytes written to <paramref name="writer" />.</returns>
326326
<remarks>To be added.</remarks>
327327
<exception cref="T:System.Text.EncoderFallbackException">
328328
<paramref name="chars" /> contains data that cannot be encoded and <paramref name="encoding" /> is configured to throw when such data is seen.</exception>

0 commit comments

Comments
 (0)