Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UTF-8 in *.cshtml

I edit the text, my english is very, very... bad

Hi!!!

I have a problem with UTF-8 in Visual Studio 2017.

I work with Asp.Net Core 1.1 and need UTF-8 in my CSHTML files.

The Some way i found to change the codification is goining in File->Save As..->In save button, click on the Save with Codification and change to Unicode (UTF-8).

But i to need do this every time, in every cshtml file.

I can set the default Codification of CSHTML , as Unicode(UTF-8)??

Tnks!!

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title> - Teste_db</title>


    <link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.css" />
    <link rel="stylesheet" href="/css/site.css" />

<body>
...

   <h2>View��  </h2>
...
</body>
like image 346
Renato Vieira Avatar asked Oct 15 '25 20:10

Renato Vieira


1 Answers

I solved my problem!!!

I found the default .cshtml files from MVC.

The files is in C:\Users\USER_NAME.nuget\packages\Microsoft.VisualStudio.Web.CodeGenerators.Mvc\1.1.0\Templates\ViewGenerator\

I edited them with notepad++, changed the format to UTF-8, now i can put a especial caracteres like çéá...

Tnks!!!

like image 182
Renato Vieira Avatar answered Oct 17 '25 10:10

Renato Vieira