Created
May 18, 2011 18:35
-
-
Save chengfred/979204 to your computer and use it in GitHub Desktop.
Simplenote iOS note encoding
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
NSString *notestring = [[currentNote noteDictionaryWithContent: YES] JSONRepresentation]; | |
// notestring now contains a JSON string with note data | |
NSString *encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes( | |
NULL, | |
(CFStringRef)notestring, | |
NULL, | |
(CFStringRef)@"!*'();:@&=+$,/?%#[]", | |
kCFStringEncodingUTF8 ); | |
NSData *data = [encodedString dataUsingEncoding:NSUTF8StringEncoding]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment