Skip to content

Instantly share code, notes, and snippets.

@Abeansits
Created April 30, 2013 07:40
Show Gist options
  • Save Abeansits/5487191 to your computer and use it in GitHub Desktop.
Save Abeansits/5487191 to your computer and use it in GitHub Desktop.
Printing character per character to find those hard to see invisible characters that may mess up your JSON-parsing or similar.
const unsigned char *ptr = [data bytes];
for(NSUInteger i=0; i<[data length]; ++i) {
unsigned char c = *ptr++;
NSLog(@"char=%c hex=%x", c, c);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment