asp.net-mvcentity-frameworkdiacritics

Entity Framework Model and ASP.NET MVC 2 Preview 2: Ρroblem with umlauts


I have this piece of a HTML in a View:

<% foreach (var item in Model) { %>

    <tr>
        <td>
            <%= Html.ActionLink("Edit", "Edit", new { id = item.HändlerID })%>
        </td>
        <td>
            <%= Html.Encode(item.HändlerID) %>
        </td>
        <td>
            <%= Html.Encode(item.HändlerName) %>
        </td>
        <td>
            <%= Html.Encode(item.HändlerOrt) %>
        </td>
    </tr>

<% } %>

The item is an entity which contain properties with umlauts (Händler...) as u can see. Now, when I start the page an error occurs. The "ä" is transformed in a strange character.


Solution

  • Try to re-save your view in different encoding. It's a really loooooong shot, but who knows.

    in VS => File => Advanced Save Options => Unicode 650001 => OK