dotnet / dotnet/dotnet-api-docs
Two examples for each override of HtmlEncode incorrectly encode the (Space) character
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
### Type of issue
Code doesn't work
### Description
Two of the code examples given for [HtmlEncode(String, Boolean)](https://learn.microsoft.com/en-us/dotnet/api/system.web.security.antixss.antixssencoder.htmlencode?view=netframework-4.8#system-web-security-antixss-antixssencoder-htmlencode(system-string-system-boolean)) and for [HtmlEncode(String, TextWriter)](https://learn.microsoft.com/en-us/dotnet/api/system.web.security.antixss.antixssencoder.htmlencode?view=netframework-4.8#system-web-security-antixss-antixssencoder-htmlencode(system-string-system-io-textwriter)) incorrectly encode the (Space) character.
|Code Example | Incorrect Encoding| Correct Encoding |
|----------------|----------------|------------------|
|alert('XSS Attack!'); |` alert('XSS Attack!');`|`alert('XSS Attack!');`|
|"Anti-Cross Site Scripting Namespace"| `"Anti-Cross Site Scripting Namespace"` | `"Anti-Cross Site Scripting Namespace"` |
### Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.web.security.antixss.antixssencoder.htmlencode?view=netframework-4.8
### Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Web.Security.AntiXss/AntiXssEncoder.xml
### Document Version Independent Id
6789ad2b-05d7-e3fe-97b3-27e6ce8d971f
### Article author
@Rick-Anderson
Contributor guide
Assessment
This issue has not been assessed yet.