Need help to pass right code charts to AntiXssEncoder.MarkAsSafe() so that below input would be persisted without replace that character with hex value. Hyphen "–" seems to fall under Basic Latin code charts but after adding it to a safe list HtmlEncode() method encode it to –.
sample code - (target framework - 4.5.1)
using System.Web.Security.AntiXss;
static void Main(string[] args)
{
AntiXssEncoder.MarkAsSafe(LowerCodeCharts.Default, LowerMidCodeCharts.LatinExtendedAdditional | LowerMidCodeCharts.CombiningDiacriticalMarksSupplement,
MidCodeCharts.LatinExtendedC | MidCodeCharts.MiscellaneousMathematicalSymbolsA,
UpperMidCodeCharts.CyrillicExtendedA,
UpperCodeCharts.Specials);
var value = AntiXssEncoder.HtmlEncode("Test –", false);
Console.Write(value); // EXPECTED VALUE "Test –" AND NOT “Test –"
}