修复JSON 序列化时的 Unicode 转义问题

This commit is contained in:
zhengxuan.zhang
2026-05-21 14:57:29 +08:00
parent 2ac84ecc85
commit 01b12bb246
3 changed files with 4 additions and 1 deletions
@@ -24,6 +24,7 @@ namespace XplorePlane.Services.InspectionResults
private static readonly JsonSerializerOptions JsonOptions = new()
{
WriteIndented = true,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
Converters = { new JsonStringEnumConverter() }
};
@@ -18,6 +18,7 @@ namespace XplorePlane.Services
private static readonly JsonSerializerOptions JsonOptions = new()
{
WriteIndented = true,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
Converters = { new JsonStringEnumConverter() }
};
+2 -1
View File
@@ -23,7 +23,8 @@ namespace XplorePlane.Services.Recipe
private static readonly JsonSerializerOptions _jsonOptions = new()
{
WriteIndented = true
WriteIndented = true,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
};
public RecipeService(