JsonSerializer.Serialize自动会对非Ascii字符进行转义,变成诸如"u5468"之类的东西,对网页应用比较友好,当我们不需这个转义的时候,必须设置JsonSerializerOptions如下:
var options = new JsonSerializerOptions
{
Encoder = JavaScriptEncoder.Create(UnicodeRanges.CjkUnifiedIdeographs,UnicodeRanges.CjkUnifiedIdeographsExtensionA),
};
JsonSerializer.Serialize(obj,options);