Search code examples
asp.net-mvcasp.net-mvc-3razorlocalizationdiacritics

ASP.NET MVC 3 jquery : French accent characters are showing as #233 characters on screen


I have ASP.NET MVC 3 application having resource files in english and french. A text 'Sélectionner la pharmacie' is stored in a french resource file.

When the value is read from resource files with razor syntax, it shows 'S#233;lectionner la pharmacie' instead of 'Sélectionner la pharmacie'.

e.g.
@MyResources.Strings_Resources.lbl_SelectPharmacy

Is there a way I can make it show the french accent characters ?


Solution

  • I suspect that your text is already encoded and razor is trying to encode it again (it encodes all outputs)

    Try with

    @Html.Raw(MyResources.Strings_Resources.lbl_SelectPharmacy)