I am using the following method to HtmlEncode
some text
that it\'s in Spanish
, like this:
string word = \"configuració
HtmlEncode(word); does only encode ISO 8859-1 (Latin-1). Which means your input needs to be encoded in ISO 8859-1. The ó is not in the iso standard, you can try to use the AntiXss encoder:
Microsoft.Security.Application.AntiXss.HtmlEncode("ó");
or Microsoft.Security.Application.Encoder.HtmlEncode("ó");