asp.netcore mvc Json中文乱码

.Net:5.0

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllersWithViews();

            services.AddControllers().AddJsonOptions(options =>
            {
                options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
            });


        }

 

posted @ 2021-01-14 10:57  bky123  阅读(244)  评论(0编辑  收藏  举报