I need HTML to encode some text that may or may not already be encoded in HTML (perhaps only partially). Is the following safe? Are there any characters / encodings that can cause unexpected behavior?
HttpUtility.HtmlEncode(HttpUtility.HtmlDecode(text))
thanks
source share