Created
April 2, 2013 15:53
-
-
Save leppie/5293332 to your computer and use it in GitHub Desktop.
Scheme Unicode identifiers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static bool IsLetterOrUnicodeSchemeIdentifier(char num) | |
{ | |
if (num < '\x0080') | |
{ | |
return char.IsLetter(num); | |
} | |
switch (char.GetUnicodeCategory(num)) | |
{ | |
case UnicodeCategory.UppercaseLetter: | |
case UnicodeCategory.LowercaseLetter: | |
case UnicodeCategory.TitlecaseLetter: | |
case UnicodeCategory.ModifierLetter: | |
case UnicodeCategory.OtherLetter: | |
case UnicodeCategory.NonSpacingMark: | |
case UnicodeCategory.SpacingCombiningMark: | |
case UnicodeCategory.EnclosingMark: | |
case UnicodeCategory.DecimalDigitNumber: | |
case UnicodeCategory.LetterNumber: | |
case UnicodeCategory.OtherNumber: | |
case UnicodeCategory.PrivateUse: | |
case UnicodeCategory.ConnectorPunctuation: | |
case UnicodeCategory.DashPunctuation: | |
case UnicodeCategory.OtherPunctuation: | |
case UnicodeCategory.MathSymbol: | |
case UnicodeCategory.CurrencySymbol: | |
case UnicodeCategory.ModifierSymbol: | |
case UnicodeCategory.OtherSymbol: | |
return true; | |
} | |
return false; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment