I am attempting to write some text to some website while using System.Web.HttpUtility.HtmlEncode function in C#. The string parameter which i share with the function has some Atmosphere.Newline's inside it, but they're not prepared online. Does anybody know why this really is and just how I'm able to repair it. Thanks ahead of time.

Newline is prepared like a physical line break so you'll have to either wrap inside a pre:

response.Write("<pre>" + HttpUtility.HtmlEncode(str) + "</pre>");

Or replace the brand new line having a BR Once you have HtmlEncoded (or it'll scribe the BR too):

response.Write(HttpUtility.HtmlEncode(str).Replace("\n", "<br />"));

Given its HTML NewLine figures don't display as whitespace. Try changing your brand-new line figures with <br/> elements.