evemen

在  .net core mvc 视图输出 变量的时候 默认使用的是 UnicodeRanges.BasicLatin  进行的编码 

所以 输出中文后在查看源码的时候是进过编码了的 。

解决方案  

  在 Startup.cs 的 ConfigureServices() 方法中添加下面的一行代码:


services.AddSingleton(HtmlEncoder.Create(UnicodeRanges.All));
---------------------
作者:megoodtoo
来源:CSDN
原文:https://blog.csdn.net/MeGoodtoo/article/details/73481173
 

分类:

技术点:

相关文章:

  • 2021-09-19
  • 2021-07-02
  • 2021-07-10
  • 2022-12-23
  • 2021-08-21
  • 2021-11-21
猜你喜欢
  • 2021-06-11
  • 2021-06-29
  • 2022-12-23
  • 2022-01-07
  • 2022-02-16
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案