Skip to content

[Blazor] The App.razor is not created default with UTF-8 encoding #18058

@vulcanlee

Description

@vulcanlee

Because App.razor of Blazor project is not save with encoding default by UTF-8 (the default encoding is Chinese Traditional (Big5) - Codepage 950), cannot show any Chinese text of UTF-8.

To Reproduce this issue ( I also recording this problem and you can downlod Reproduce video without audio ), you can create a Blazor of server side project and open App.razor file to change as following.

<Router AppAssembly="@typeof(Program).Assembly">
    <Found Context="routeData">
        <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
    </Found>
    <NotFound>
        <LayoutView Layout="@typeof(MainLayout)">
            <p>抱歉,此地址沒有任何內容。</p>
        </LayoutView>
    </NotFound>
</Router>

To run this Blazor project and enter a not exist url, it will show incorrect context.

If I use function from menu : [File] > [Save App.razor as...] > [Save with Encoding...] and change Encoding property to "Unicode (UTF-8 with signature) - Codepage 65001" on "Advanced save options dialog"

Then re-run this Blazor project, the page is working fine as following:

My environment is Windows 10 Profession 1099 build 18363.535 of Chinese version

  • ASP.NET Core version : 3.1
  • Include the output of dotnet --info
  • Visual Studio 2019 is 16.4.2

Metadata

Metadata

Assignees

Labels

ExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.area-blazorIncludes: Blazor, Razor Components

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions