在查看MVC3统一code显示器 [英] MVC3 Unicode display on View
问题描述
我有没有出现被渲染它需要西班牙性状一个MVC3剃刀页。它取代了字符用??。所以,我gustaría将是古斯塔夫??一个
I have an MVC3 razor page that does not appear to be rendering the Spanish Characters it needs to. It replaces the characters with a ??. So me gustaría would be be gustar??a
中的字符串也呈现与@ html.raw()帮手,但除去这并不要么解决问题。
The strings are also rendered with the @html.raw() helper, but removing this does not fix the issue either.
原来,在我的布局我有
<meta charset="utf-8" />
但是,当我把它改为UTF-16它并没有解决问题。
But when I changed it to utf-16 it did not fix the problem.
我失去了一些东西简单?
Am I missing something simple?
推荐答案
这不是把正确的字符集的字符串到您的文件,但这个文件的实际编码。你必须确保你的文件是UTF-8 EN codeD。
It's not about putting correct charset string to your file, but about actual encoding of this file. You must ensure that your file is UTF-8 encoded.
我可以推荐给:
-
下载所谓的免费工具记事本+
用记事本打开文件++
Open your file with Notepad++
转到菜单中的编码,子菜单恩code以UTF-8无BOM
Go to menu "Encoding", submenu "Encode in UTF-8 without BOM"
看你的西班牙语字母,他们可能需要更换。
Look at your Spanish letters, they may need to be replaced.
保存文件。
然后重新编译您的网站,然后再试一次。希望这有助于。
Then recompile your website and try again. Hope this helps.
这篇关于在查看MVC3统一code显示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!