Objective-C
Objective-C
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat Objective-C Downloads
#import <CkoCrypt2.h>
#import <NSString.h>
CkoCrypt2 *crypt = [[CkoCrypt2 alloc] init];
NSString *s = @"< é ü ç Ω Hello & World ✓ >";
NSString *htmlEncoded = [crypt EncodeString: s charset: @"utf-8" encoding: @"html"];
NSLog(@"%@",htmlEncoded);
// Output:
// < é ü ç Ω Hello & World ✓ >
// To decode:
s = [crypt DecodeString: htmlEncoded charset: @"utf-8" encoding: @"html"];
NSLog(@"%@",s);
// Output:
// < é ü ç Ω Hello & World ✓ >