.NET 6 解決System.Text.Json序列化後會將所有非ASCII轉為Unicode
目的
序列化時不自動將非ASCII轉為Unicode
建立新專案
選擇ASP.NET Core Web API專案範本,並執行下一步
設定新的專案
其他資訊
直接進行下一步
編輯WeatherForecastController檔案
將預設的API註解,寫入新的Action,預設不會引用System.Text.Json,記得在最上面using
執行結果
參考
How to serialize and deserialize
範例檔
Last updated