7

This is fragment from View file:

@{
    ViewData["Title"] = "qwerty **Николай**";
}
<div class="row">
<div class="grid-x grid-padding-x">
    <div class="large-12 cell">
        <h1>Николай Петюх</h1>
    </div>        
</div>    

And this is output fragment in browser:

<head>
    <meta charset="utf-8" />
    <meta http-equiv="x-ua-compatible" content="ie=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>qwerty **&#x41D;&#x438;&#x43A;&#x43E;&#x43B;&#x430;&#x439;**</title>
    <link rel="icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">


        <link rel="stylesheet" href="/lib/foundation/css/foundation.css" />
        <link rel="stylesheet" href="/css/app.css?v=drh6roXOzy8LX0aJC9iKPBtj4DtYf06wh1r9I6IvZA0" />


</head>
<body>

<div class="grid-container">
    <div class="row">
        <div class="grid-x grid-padding-x">
            <div class="large-12 cell">
                <h1>Николай Петюх</h1>
            </div>        
        </div>    
    </div>    
</div>

Anybody knows how to prevent cyrillic characters encoding to &#XXXX;?

3
  • I copied your code from the question and tested . Razor renders <title>qwerty **Николай**</title> to me Commented Nov 28, 2017 at 15:39
  • Interesting. Do you know, where is Razor settings. Sorry for stupid question, but im newbie Commented Nov 28, 2017 at 15:49
  • Found solution. Commented Nov 28, 2017 at 16:05

1 Answer 1

13

Resolve problem by adding to Startup.cs next code:

services.Configure<WebEncoderOptions>(options =>
            {
                options.TextEncoderSettings = new TextEncoderSettings(UnicodeRanges.All);
            });

in ConfigureServices class.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.