Created
August 5, 2013 22:25
-
-
Save rsaunders100/6160147 to your computer and use it in GitHub Desktop.
Logs all unicode character with numeric value up to and including 2^16
This file contains 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
+ (void) logCharacterSet:(NSCharacterSet*)characterSet | |
{ | |
unichar unicharBuffer[20]; | |
int index = 0; | |
for (unichar uc = 0; uc < (0xFFFF); uc ++) | |
{ | |
if ([characterSet characterIsMember:uc]) | |
{ | |
unicharBuffer[index] = uc; | |
index ++; | |
if (index == 20) | |
{ | |
NSString * characters = [NSString stringWithCharacters:unicharBuffer length:index]; | |
NSLog(@"%@", characters); | |
index = 0; | |
} | |
} | |
} | |
if (index != 0) | |
{ | |
NSString * characters = [NSString stringWithCharacters:unicharBuffer length:index]; | |
NSLog(@"%@", characters); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment