Mapping Unicode MVC3 in a View

I have an MVC3 razor page that does not seem to display the Spanish characters it needs. It replaces characters with character. So what will gustarรญa be gustar ??

Lines are also displayed using the @ html.raw () helper, but removing this also does not fix the problem.

Originally in my layout I had

<meta charset="utf-8" /> 

But when I changed it to utf-16, this did not fix the problem.

Am I missing something simple?

+2
source share
1 answer

It's not about inserting the correct charset line into your file, but about the actual encoding of this file. You must ensure that your file is encoded in UTF-8 encoding.

I can recommend:

  • Download a free tool called Notepad ++

  • Open file with Notepad ++

  • Go to the menu "Encoding", submenu "Encrypt in UTF-8 without specification"

  • Look at your Spanish letters; you may need to replace them.

  • Save the file.

Then recompile your site and try again. Hope this helps.

+3
source

Source: https://habr.com/ru/post/1200380/


All Articles