//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ namespace System.Web.Security.AntiXss.CodeCharts { using System.Collections; /// /// Provides safe character positions for the lower middle section of the UTF code tables. /// internal static class LowerMiddle { /// /// Determines if the specified flag is set. /// /// The value to check. /// The flag to check for. /// true if the flag is set, otherwise false. public static bool IsFlagSet(LowerMidCodeCharts flags, LowerMidCodeCharts flagToCheck) { return (flags & flagToCheck) != 0; } /// /// Provides the safe characters for the Myanmar code table. /// /// The safe characters for the code table. public static IEnumerable Myanmar() { return CodeChartHelper.GetRange(0x1000, 0x109F); } /// /// Provides the safe characters for the Georgian code table. /// /// The safe characters for the code table. public static IEnumerable Georgian() { return CodeChartHelper.GetRange(0x10A0, 0x10FC, i => (i >= 0x10C6 && i <= 0x10CF)); } /// /// Provides the safe characters for the Hangul Jamo code table. /// /// The safe characters for the code table. public static IEnumerable HangulJamo() { return CodeChartHelper.GetRange(0x1100, 0x11FF); } /// /// Provides the safe characters for the Ethiopic code table. /// /// The safe characters for the code table. public static IEnumerable Ethiopic() { return CodeChartHelper.GetRange(0x1200, 0x137C, i => (i == 0x1249 || i == 0x124E || i == 0x124F || i == 0x1257 || i == 0x1259 || i == 0x125E || i == 0x125F || i == 0x1289 || i == 0x128E || i == 0x128F || i == 0x12B1 || i == 0x12B6 || i == 0x12B7 || i == 0x12BF || i == 0x12C1 || i == 0x12C6 || i == 0x12C7 || i == 0x12D7 || i == 0x1311 || i == 0x1316 || i == 0x1317 || (i >= 0x135B && i <= 0x135E))); } /// /// Provides the safe characters for the Ethiopic Supplement code table. /// /// The safe characters for the code table. public static IEnumerable EthiopicSupplement() { return CodeChartHelper.GetRange(0x1380, 0x1399); } /// /// Provides the safe characters for the Cherokee code table. /// /// The safe characters for the code table. public static IEnumerable Cherokee() { return CodeChartHelper.GetRange(0x13A0, 0x13F4); } /// /// Provides the safe characters for the Unified Canadian Aboriginal Syllabic code table. /// /// The safe characters for the code table. public static IEnumerable UnifiedCanadianAboriginalSyllabics() { return CodeChartHelper.GetRange(0x1400, 0x167F); } /// /// Provides the safe characters for the Ogham code table. /// /// The safe characters for the code table. public static IEnumerable Ogham() { return CodeChartHelper.GetRange(0x1680, 0x169C); } /// /// Provides the safe characters for the Runic code table. /// /// The safe characters for the code table. public static IEnumerable Runic() { return CodeChartHelper.GetRange(0x16A0, 0x16F0); } /// /// Provides the safe characters for the Tagalog code table. /// /// The safe characters for the code table. public static IEnumerable Tagalog() { return CodeChartHelper.GetRange(0x1700, 0x1714, i => (i == 0x170D)); } /// /// Provides the safe characters for the Hanunoo code table. /// /// The safe characters for the code table. public static IEnumerable Hanunoo() { return CodeChartHelper.GetRange(0x1720, 0x1736); } /// /// Provides the safe characters for the Buhid code table. /// /// The safe characters for the code table. public static IEnumerable Buhid() { return CodeChartHelper.GetRange(0x1740, 0x1753); } /// /// Provides the safe characters for the Tagbanwa code table. /// /// The safe characters for the code table. public static IEnumerable Tagbanwa() { return CodeChartHelper.GetRange(0x1760, 0x1773, i => (i == 0x176D || i == 0x1771)); } /// /// Provides the safe characters for the Khmer code table. /// /// The safe characters for the code table. public static IEnumerable Khmer() { return CodeChartHelper.GetRange(0x1780, 0x17F9, i => (i == 0x17DE || i == 0x17DF || (i >= 0x17EA && i <= 0x17EF))); } /// /// Provides the safe characters for the Mongolian code table. /// /// The safe characters for the code table. public static IEnumerable Mongolian() { return CodeChartHelper.GetRange(0x1800, 0x18AA, i => (i == 0x180F || (i >= 0x181A && i <= 0x181F) || (i >= 0x1878 && i <= 0x187F))); } /// /// Provides the safe characters for the Unified Canadian Aboriginal Syllabic Extended code table. /// /// The safe characters for the code table. public static IEnumerable UnifiedCanadianAboriginalSyllabicsExtended() { return CodeChartHelper.GetRange(0x18B0, 0x18F5); } /// /// Provides the safe characters for the Limbu code table. /// /// The safe characters for the code table. public static IEnumerable Limbu() { return CodeChartHelper.GetRange(0x1900, 0x194F, i => (i == 0x191D || i == 0x191E || i == 0x191F || (i >= 0x192C && i <= 0x192F) || (i >= 0x193C && i <= 0x193F) || i == 0x1941 || i == 0x1942 || i == 0x1943)); } /// /// Provides the safe characters for the Tai Le code table. /// /// The safe characters for the code table. public static IEnumerable TaiLe() { return CodeChartHelper.GetRange(0x1950, 0x1974, i => (i == 0x196E || i == 0x196F)); } /// /// Provides the safe characters for the New Tai Lue code table. /// /// The safe characters for the code table. public static IEnumerable NewTaiLue() { return CodeChartHelper.GetRange(0x1980, 0x19DF, i => ((i >= 0x19AC && i <= 0x19AF) || (i >= 0x19CA && i <= 0x19CF) || (i >= 0x19DB && i <= 0x19DD))); } /// /// Provides the safe characters for the Khmer Symbols code table. /// /// The safe characters for the code table. public static IEnumerable KhmerSymbols() { return CodeChartHelper.GetRange(0x19E0, 0x19FF); } /// /// Provides the safe characters for the Khmer Symbols code table. /// /// The safe characters for the code table. public static IEnumerable Buginese() { return CodeChartHelper.GetRange(0x1A00, 0x1A1F, i => (i == 0x1A1C || i == 0x1A1D)); } /// /// Provides the safe characters for the Tai Tham code table. /// /// The safe characters for the code table. public static IEnumerable TaiTham() { return CodeChartHelper.GetRange(0x1A20, 0x1AAD, i => (i == 0x1A5F || i == 0x1A7D || i == 0x1A7E || (i >= 0x1A8A && i <= 0x1A8F) || (i >= 0x1A9A && i <= 0x1A9F))); } /// /// Provides the safe characters for the Balinese code table. /// /// The safe characters for the code table. public static IEnumerable Balinese() { return CodeChartHelper.GetRange(0x1B00, 0x1B7C, i => (i >= 0x1B4C && i <= 0x1B4F)); } /// /// Provides the safe characters for the Sudanese code table. /// /// The safe characters for the code table. public static IEnumerable Sudanese() { return CodeChartHelper.GetRange(0x1B80, 0x1BB9, i => (i >= 0x1BAB && i <= 0x1BAD)); } /// /// Provides the safe characters for the Lepcha code table. /// /// The safe characters for the code table. public static IEnumerable Lepcha() { return CodeChartHelper.GetRange(0x1C00, 0x1C4F, i => ((i >= 0x1C38 && i <= 0x1C3A) || (i >= 0x1C4A && i <= 0x1C4C))); } /// /// Provides the safe characters for the Ol Chiki code table. /// /// The safe characters for the code table. public static IEnumerable OlChiki() { return CodeChartHelper.GetRange(0x1C50, 0x1C7F); } /// /// Provides the safe characters for the Vedic Extensions code table. /// /// The safe characters for the code table. public static IEnumerable VedicExtensions() { return CodeChartHelper.GetRange(0x1CD0, 0x1CF2); } /// /// Provides the safe characters for the Phonetic Extensions code table. /// /// The safe characters for the code table. public static IEnumerable PhoneticExtensions() { return CodeChartHelper.GetRange(0x1D00, 0x1D7F); } /// /// Provides the safe characters for the Phonetic Extensions Supplement code table. /// /// The safe characters for the code table. public static IEnumerable PhoneticExtensionsSupplement() { return CodeChartHelper.GetRange(0x1D80, 0x1DBF); } /// /// Provides the safe characters for the Combining Diacritical Marks Supplement code table. /// /// The safe characters for the code table. public static IEnumerable CombiningDiacriticalMarksSupplement() { return CodeChartHelper.GetRange(0x1DC0, 0x1DFF, i => (i >= 0x1DE7 && i <= 0x1DFC)); } /// /// Provides the safe characters for the Latin Extended Addition code table. /// /// The safe characters for the code table. public static IEnumerable LatinExtendedAdditional() { return CodeChartHelper.GetRange(0x1E00, 0x1EFF); } } }