【发布时间】:2019-02-25 21:13:31
【问题描述】:
我无法显示非英文字母,例如:
<h3>żąćń</h3> 因为它显示为����
我尝试添加
<meta charset="ISO-8859-1"><meta charset="ISO-8859-2"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"><meta charset="UTF-8">
到页面布局中的head部分,它在html源代码视图中。
还有:
services.Configure<WebEncoderOptions>(options =>
{
options.TextEncoderSettings = new TextEncoderSettings(UnicodeRanges.All);
});
知道如何解决这个问题吗?
【问题讨论】:
-
您是否在其他浏览器上尝试过该页面?
-
@juunas 刚刚在 firefox 和 chrome 上尝试过,但没有积极的结果
-
也许您需要转义 html 字符?
-
您是否尝试使用 utf8 编码保存您的 .cshtml? VS 默认不使用 UTF8
-
你使用哪种css字体?
标签: c# html asp.net asp.net-mvc asp.net-core