ToUpper () with accents

5

I have a string , where I want to return it in uppercase, to standardize the information. I'm using ToUpper() . However, when this string has accents the text gets scrambled.

How do I receive the text with normal accents, or remove the accents and receive the text correctly?

My View calling string :

insira o có[email protected](model => model.sLotacao).ToString().ToUpper()

Page result:

SECRETARIA M. DE EDUCAçãO
    
asked by anonymous 14.01.2015 / 13:07

1 answer

5

Try specifying culture information by passing an object CultureInfo for method ToUpper :

insira o código @Html.DisplayFor(model => model.sLotacao).ToString().ToUpper(CultureInfo.CreateSpecificCulture("pt-BR"))

Still, if it does not work, try simply not using @Html.DisplayFor .

    
14.01.2015 / 13:18