Ever need to HTML Encode a string? This useful extension method will do it for you:
/// <summary>
/// Extension method to HTML encode any string characters with ASCII > 127
/// </summary>
/// <param name="str">string to be encoded</param>
/// <returns>Encoded string</returns>
public static string ToHtml(this string str)
{
return string.Join("", str.ToCharArray().Select(c => (int)c > 127 ? "&#" + (int)c + ";" : c.ToString()).ToArray());
}