Created
May 12, 2012 20:00
-
-
Save andreortiz82/2668629 to your computer and use it in GitHub Desktop.
encode / decode html text
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*) encodeString:(NSString *)value { | |
NSString *rawText = value; | |
NSString *encodedText = [rawText stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
NSLog(@"Encoded text: %@", encodedText); | |
NSString *decodedText = [encodedText stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
NSLog(@"Original text: %@", decodedText); | |
return encodedText; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment