diff --git a/Helpers/SimApiUtil.cs b/Helpers/SimApiUtil.cs
index ee035f7..5045c56 100644
--- a/Helpers/SimApiUtil.cs
+++ b/Helpers/SimApiUtil.cs
@@ -1,6 +1,9 @@
using System.Security.Cryptography;
using System.Text;
+using System.Text.Encodings.Web;
+using System.Text.Json;
using System.Text.RegularExpressions;
+using System.Text.Unicode;
namespace SimApi.Helpers
{
@@ -36,5 +39,18 @@ namespace SimApi.Helpers
return strbul.ToString();
}
+
+ ///
+ /// 将对象序列化成JSON (控制台输出中文不会被编码)
+ ///
+ ///
+ ///
+ public static string Json(object obj)
+ {
+ return JsonSerializer.Serialize(obj, new JsonSerializerOptions
+ {
+ Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
+ });
+ }
}
}
\ No newline at end of file