Created
August 28, 2015 14:49
-
-
Save uliwitness/e86d35804ec3815c6e74 to your computer and use it in GitHub Desktop.
Test program that shows that NSString can do '\0' characters, however NSLog will terminate its entire output at encountering the first one:
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
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSString *str = [[NSString alloc] initWithBytes: "\0\r" length: 2 encoding: NSASCIIStringEncoding]; | |
NSLog(@"len = %zu \"%@\"", str.length, str); | |
} | |
} |
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
2015-08-28 16:48:07.729 Untitled[4116:2242682] len = 2 " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment