views:

102

answers:

1

Hi, I am experiencing some weird encoding behaviour in my ASP.NET MVC project.

In my Site.Master there is

<div class="logo">
        <a href="<%=Url.Action("Index", "Win7")%>"><%= Html.Encode("Windows 7 Tutoriál") %></a></div>

which translates to the resulting page as

<div class="logo">
        <a href="/">Windows 7 Tutoriál</a></div>

However, in the Index.aspx there is

<h1>
    Windows 7 Tutoriál</h1>

which translates correctly on the same resulting page. I do have

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

as my first line in <head>. Locally, both files are saved in UTF-8 encoding.

Any ideas why is this happening and how to fix it?

Thanks in advance.

+1  A: 

Ehm, I just found out, that both files are indeed in UTF-8, however, one of the was using version with signature while the other was without. I wonder when VS decided to change these. Thanks to commentators anyway.

Trimack