C# Blazor Metatags

Daniil Fominykh 0 Reputation points
2023-12-26T21:09:49.99+00:00

Good day developers. I ran into a problem with meta tags. My site is used in Russian, everything works fine, but it remains a mystery to me why meta tags are not displayed in the source code as Russian text, but are displayed as decoded text? I've already gone through everything and notice if I write it manually in code

<meta name="description" content="Тест текст">

then this is displayed correctly, but if I have a variable set:

<meta name="description" content="@fileModel.Seo_Description">

then it looks like

<meta name="keywords" content="&#x442;&#x435;&#x441;&#x442; &#x442;&#x435;&#x43A;&#x441;&#x442;&#x442;&#x442" />

does anyone have any suggestions? Thank you and have a nice holiday.

Test Web-siteScreenshot_4

Screenshot_3

Developer technologies | .NET | Blazor
Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,926 Reputation points Volunteer Moderator
    2023-12-26T23:40:46.78+00:00

    That is correct. Your source is Cyrillic Unicode 16 chars, and metatag should be utf8. Razor just escaped them. It’s perfectly valid.

    Note: when you type, you are using utf8 with a Cyrillic code page.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.