Vinicius Ottoni
Vinicius Ottoni

Reputation: 4677

Accentuation in pages are behaving differently

I have the following view:

@model MyModel1
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Breadcrumb = "Gerenciar Acessos - Índices";
}

The second one:

@model MyModel2 
@{
    ViewBag.Title = "Pesquisar";
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Breadcrumb = "Visualizar Bilhetes de Ligação";
}

In the first one breadcrumb the output html is: Gerenciar Acessos - Índices.

In the second one breadcrumb the output html is: Visualizar Bilhetes de Ligação

Why? Oo

OBS: I'm using ASP.NET MVC 3.

--EDIT

<div id="breadcrumb">
    @Html.Raw(ViewBag.Breadcrumb)
</div>

Upvotes: 0

Views: 340

Answers (2)

Vinicius Ottoni
Vinicius Ottoni

Reputation: 4677

To solve this, i change the Save Options of the file:

  • Open the problematic file in Visual Studio.
  • On the File menu click “Advanced Save Options“
  • From “Encoding” combo select "Unicode - Codepage 1200"
  • Click OK.
  • Save the file (Ctrl + S) ^^

Upvotes: 0

Sprachprofi
Sprachprofi

Reputation: 1259

It must have to do with the encoding of these strings. See if the second file might be saved as UTF-8 but the first file not. I'm not too familiar with ASP.NET; in Ruby another problem source might be if you're missing the "# encoding: UTF-8" tag at the top of the code. Or of course if you're editing one of the strings later with a string function that doesn't support Unicode.

Upvotes: 1

Related Questions