Skip to content

Instantly share code, notes, and snippets.

@rsaunders100
Created August 5, 2013 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsaunders100/6160147 to your computer and use it in GitHub Desktop.
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
+ (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