2017-10-17 72 views
0

enter image description here 並添加西裏爾字母,以任何角度成分的,例如home.component.html,我得到的是這樣的: enter image description here古怪的符號而不是西里爾

我沒有改變別的。 在_Layout.cshtml我有<meta charset="utf-8" /> 另外,我有這個問題在其他電腦上。 如何解決它?

+1

我認爲我們需要看你怎麼加的西裏爾字母。 – Amy

+0

共享更多代碼,展示如何添加角度組件 – Ibo

+0

我不會在此項目中創建任何新內容,它是默認的asp.net核心+角度項目。 我只是改變了html的一小部分,例如'

Текст

'in'home.component.html' – Illia

回答

0

通常情況下,Angular UTF-8完全可以勝任。

我假設你在Windows操作系統上。如果你安裝了Git Bash,你可以運行file -i <file>,它會馬上告訴你編碼。我相信text/plain; charset=utf-8會效果最好。如果您看到其他一些格式,使用UTF-8進行簡單的重新保存應該可以解決問題。


例子:

[email protected] MINGW64 ~ 
$ file -i /c/temp/demo* 
/c/temp/demo-1.html: text/plain; charset=utf-8 
/c/temp/demo-2.html: text/plain; charset=us-ascii 
/c/temp/demo-3.html: inode/x-empty; charset=binary 
/c/temp/demo-4.html: text/plain; charset=utf-16le 
+0

我改變了所有'.ts'中的編碼,'.cshtml','html'從沒有BOM的utf-8轉換到utf-8,現在它工作正常。謝謝你的答案。 – Illia