Skip to content Skip to sidebar Skip to footer

Htmlencode With Html Entity Name, Is It Possible?

I am using the following method to HtmlEncode some text that it's in Spanish, like this: string word = 'configuración'; string encodedWord = System.Net.WebUtility.HtmlEncode(word)

Solution 1:

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("ó");

Post a Comment for "Htmlencode With Html Entity Name, Is It Possible?"