解决中文输出为实体编码的问题。
using Microsoft.Extensions.WebEncoders;
using System.Text.Encodings.Web;
using System.Text.Unicode;
/*……*/
public void ConfigureServices(IServiceCollection services)
{
services.Configure<WebEncoderOptions>(options =>
{
options.TextEncoderSettings = new TextEncoderSettings(UnicodeRanges.BasicLatin);
options.TextEncoderSettings.AllowRange(UnicodeRanges.CjkUnifiedIdeographs);
});
/*……*/
}