Documentation of HtmlEncoder.EncodeUtf8 fails to mention that OperationStatus.InvalidData is *never* returned.
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 75/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- csharp
- Domain
- documentation
Research direction
Start in xml/System.Text.Encodings.Web/TextEncoder.xml and locate the EncodeUtf8 documentation for the linked overload. Check how its return status is described, then update the documentation to explain invalid UTF-8 substitution and that InvalidData is never returned; done means the generated API page makes these behaviors explicit.
Written by the indexing model from the issue text.
Description
Type of issue
Missing information
Description
The documentation simply specifies "Returns: OperationStatus A status code that describes the result of the encoding operation."
This leads to the assumption, after one looks at the available enum values, that the method performs some form of validation, i.e. can return OperationStatus.InvalidData. This is not the case. It always substitutes invalid UTF-8 with Rune.ReplacementChar (U+FFFD) and proceeds with the encoding unperturbed, always returning success unless it runs into the other two failure options of DestinationTooSmall or NeedMoreData (the latter only if param isFinalBlock is false).
There is no mention of this either on the method nor at the class description level: https://learn.microsoft.com/en-us/dotnet/api/system.text.encodings.web.textencoder?view=net-10.0
Only way to find out is when unexpected output is encountered in production / tests or if one closely examines the source code.
Page URL
Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Text.Encodings.Web/TextEncoder.xml
Document Version Independent Id
fe83a6cc-fcae-66ff-b7a5-154fcfdb6d48
Platform Id
9ea117b6-6558-ee75-e0ca-d7451eac5e22
Article author
@dotnet-bot
- Dominant language
- C#
- Stars
- 950
- Forks
- 1.7k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 38
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/dotnet-api-docs
-
untriaged
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dotnet/dotnet-api-docs#13039 · 1 comment ·
-
DisplayAttribute string properties: Remarks incorrectly state the property performs resource lookup Openarea-System.ComponentModel.DataAnnotations untriaged
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
dotnet/dotnet-api-docs#13023 · 1 comment ·
-
area-System.Net.Sockets untriaged
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dotnet/dotnet-api-docs#13022 · 1 comment ·
-
area-System.Runtime untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/dotnet-api-docs#13015 · 1 comment ·
-
area-System.Runtime.InteropServices untriaged
Difficulty 1/5 Under an hour Newbie friendliness 84/100
dotnet/dotnet-api-docs#12959 ·
All issues in dotnet/dotnet-api-docs
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·