Html.ReplaceLineBreaks calls WebUtility.HtmlEncode internally, so the text gets encoded by this method. As far as I know, WebUtility.HtmlEncode and HttpUtility.HtmlEncode produces the same result (unlike WebUtility.UrlEncode and HttpUtility.UrlEncode which produces different results; see https://edi.wang/post/2018/11/25/netcore-webutility-urlencode-httputility-urlencode), so it should be safe to omit HttpUtility.HtmlEncode here.