diff --git a/Falcon.SugarApi/ObjectExtend.cs b/Falcon.SugarApi/ObjectExtend.cs index 52b03c2..3d64f5c 100644 --- a/Falcon.SugarApi/ObjectExtend.cs +++ b/Falcon.SugarApi/ObjectExtend.cs @@ -5,7 +5,9 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; +using System.Text.Encodings.Web; using System.Text.Json; +using System.Text.Unicode; namespace Falcon.SugarApi { @@ -142,6 +144,7 @@ namespace Falcon.SugarApi /// <returns>转换后字符串</returns> public static string ToJson<T>(this T obj,Action<JsonSerializerOptions>? OptionBuilder = null) { var option = new JsonSerializerOptions(); + option.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); OptionBuilder?.Invoke(option); var ser = new JsonSerialize.JsonSerializeFactory().CreateJsonSerialize(option); return ser.Serialize(obj);