1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
|
//------------------------------------------------------------------------------
// <copyright file="LowerMiddle.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.Web.Security.AntiXss.CodeCharts {
using System.Collections;
/// <summary>
/// Provides safe character positions for the lower middle section of the UTF code tables.
/// </summary>
internal static class LowerMiddle {
/// <summary>
/// Determines if the specified flag is set.
/// </summary>
/// <param name="flags">The value to check.</param>
/// <param name="flagToCheck">The flag to check for.</param>
/// <returns>true if the flag is set, otherwise false.</returns>
public static bool IsFlagSet(LowerMidCodeCharts flags, LowerMidCodeCharts flagToCheck) {
return (flags & flagToCheck) != 0;
}
/// <summary>
/// Provides the safe characters for the Myanmar code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Myanmar() {
return CodeChartHelper.GetRange(0x1000, 0x109F);
}
/// <summary>
/// Provides the safe characters for the Georgian code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Georgian() {
return CodeChartHelper.GetRange(0x10A0, 0x10FC,
i => (i >= 0x10C6 && i <= 0x10CF));
}
/// <summary>
/// Provides the safe characters for the Hangul Jamo code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable HangulJamo() {
return CodeChartHelper.GetRange(0x1100, 0x11FF);
}
/// <summary>
/// Provides the safe characters for the Ethiopic code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
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)));
}
/// <summary>
/// Provides the safe characters for the Ethiopic Supplement code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable EthiopicSupplement() {
return CodeChartHelper.GetRange(0x1380, 0x1399);
}
/// <summary>
/// Provides the safe characters for the Cherokee code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Cherokee() {
return CodeChartHelper.GetRange(0x13A0, 0x13F4);
}
/// <summary>
/// Provides the safe characters for the Unified Canadian Aboriginal Syllabic code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable UnifiedCanadianAboriginalSyllabics() {
return CodeChartHelper.GetRange(0x1400, 0x167F);
}
/// <summary>
/// Provides the safe characters for the Ogham code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Ogham() {
return CodeChartHelper.GetRange(0x1680, 0x169C);
}
/// <summary>
/// Provides the safe characters for the Runic code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Runic() {
return CodeChartHelper.GetRange(0x16A0, 0x16F0);
}
/// <summary>
/// Provides the safe characters for the Tagalog code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Tagalog() {
return CodeChartHelper.GetRange(0x1700, 0x1714,
i => (i == 0x170D));
}
/// <summary>
/// Provides the safe characters for the Hanunoo code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Hanunoo() {
return CodeChartHelper.GetRange(0x1720, 0x1736);
}
/// <summary>
/// Provides the safe characters for the Buhid code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Buhid() {
return CodeChartHelper.GetRange(0x1740, 0x1753);
}
/// <summary>
/// Provides the safe characters for the Tagbanwa code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Tagbanwa() {
return CodeChartHelper.GetRange(0x1760, 0x1773,
i => (i == 0x176D ||
i == 0x1771));
}
/// <summary>
/// Provides the safe characters for the Khmer code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Khmer() {
return CodeChartHelper.GetRange(0x1780, 0x17F9,
i => (i == 0x17DE ||
i == 0x17DF ||
(i >= 0x17EA && i <= 0x17EF)));
}
/// <summary>
/// Provides the safe characters for the Mongolian code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Mongolian() {
return CodeChartHelper.GetRange(0x1800, 0x18AA,
i => (i == 0x180F ||
(i >= 0x181A && i <= 0x181F) ||
(i >= 0x1878 && i <= 0x187F)));
}
/// <summary>
/// Provides the safe characters for the Unified Canadian Aboriginal Syllabic Extended code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable UnifiedCanadianAboriginalSyllabicsExtended() {
return CodeChartHelper.GetRange(0x18B0, 0x18F5);
}
/// <summary>
/// Provides the safe characters for the Limbu code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
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));
}
/// <summary>
/// Provides the safe characters for the Tai Le code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable TaiLe() {
return CodeChartHelper.GetRange(0x1950, 0x1974,
i => (i == 0x196E ||
i == 0x196F));
}
/// <summary>
/// Provides the safe characters for the New Tai Lue code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable NewTaiLue() {
return CodeChartHelper.GetRange(0x1980, 0x19DF,
i => ((i >= 0x19AC && i <= 0x19AF) ||
(i >= 0x19CA && i <= 0x19CF) ||
(i >= 0x19DB && i <= 0x19DD)));
}
/// <summary>
/// Provides the safe characters for the Khmer Symbols code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable KhmerSymbols() {
return CodeChartHelper.GetRange(0x19E0, 0x19FF);
}
/// <summary>
/// Provides the safe characters for the Khmer Symbols code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Buginese() {
return CodeChartHelper.GetRange(0x1A00, 0x1A1F,
i => (i == 0x1A1C ||
i == 0x1A1D));
}
/// <summary>
/// Provides the safe characters for the Tai Tham code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable TaiTham() {
return CodeChartHelper.GetRange(0x1A20, 0x1AAD,
i => (i == 0x1A5F ||
i == 0x1A7D ||
i == 0x1A7E ||
(i >= 0x1A8A && i <= 0x1A8F) ||
(i >= 0x1A9A && i <= 0x1A9F)));
}
/// <summary>
/// Provides the safe characters for the Balinese code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Balinese() {
return CodeChartHelper.GetRange(0x1B00, 0x1B7C,
i => (i >= 0x1B4C && i <= 0x1B4F));
}
/// <summary>
/// Provides the safe characters for the Sudanese code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Sudanese() {
return CodeChartHelper.GetRange(0x1B80, 0x1BB9,
i => (i >= 0x1BAB && i <= 0x1BAD));
}
/// <summary>
/// Provides the safe characters for the Lepcha code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable Lepcha() {
return CodeChartHelper.GetRange(0x1C00, 0x1C4F,
i => ((i >= 0x1C38 && i <= 0x1C3A) ||
(i >= 0x1C4A && i <= 0x1C4C)));
}
/// <summary>
/// Provides the safe characters for the Ol Chiki code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable OlChiki() {
return CodeChartHelper.GetRange(0x1C50, 0x1C7F);
}
/// <summary>
/// Provides the safe characters for the Vedic Extensions code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable VedicExtensions() {
return CodeChartHelper.GetRange(0x1CD0, 0x1CF2);
}
/// <summary>
/// Provides the safe characters for the Phonetic Extensions code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable PhoneticExtensions() {
return CodeChartHelper.GetRange(0x1D00, 0x1D7F);
}
/// <summary>
/// Provides the safe characters for the Phonetic Extensions Supplement code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable PhoneticExtensionsSupplement() {
return CodeChartHelper.GetRange(0x1D80, 0x1DBF);
}
/// <summary>
/// Provides the safe characters for the Combining Diacritical Marks Supplement code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable CombiningDiacriticalMarksSupplement() {
return CodeChartHelper.GetRange(0x1DC0, 0x1DFF,
i => (i >= 0x1DE7 && i <= 0x1DFC));
}
/// <summary>
/// Provides the safe characters for the Latin Extended Addition code table.
/// </summary>
/// <returns>The safe characters for the code table.</returns>
public static IEnumerable LatinExtendedAdditional() {
return CodeChartHelper.GetRange(0x1E00, 0x1EFF);
}
}
}
|