dotnet / dotnet/aspnetcore

\u3000 character always encoded even when UnicodeRanges.CjkSymbolsandPunctuation is allowed

Open
#56,480 0 comments 0 reactions 0 assignees View on GitHub
area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

I've got a .NET Core 6 MVC Project in which I added these allowed unicode ranges

```
var encoderSettings = new TextEncoderSettings();

encoderSettings.AllowRanges(UnicodeRanges.BasicLatin);
encoderSettings.AllowRanges(UnicodeRanges.CjkUnifiedIdeographs);
encoderSettings.AllowRanges(UnicodeRanges.CjkSymbolsandPunctuation);
encoderSettings.AllowRanges(UnicodeRanges.Hiragana);
encoderSettings.AllowRanges(UnicodeRanges.Katakana);
encoderSettings.AllowRanges(UnicodeRanges.HangulSyllables);
encoderSettings.AllowRanges(UnicodeRanges.HangulJamo);
encoderSettings.AllowRanges(UnicodeRanges.HangulCompatibilityJamo);

encoderSettings.AllowCharacters('\u3000');

builder.Services.AddSingleton(HtmlEncoder.Create(encoderSettings));
builder.Services.AddWebEncoders(encoders =>
{
encoders.TextEncoderSettings = encoderSettings;
});
```
But when rendered the page always show " "

### Expected Behavior

The character should appear correctly

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

6

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.