#import <Foundation/Foundation.h> @interface NSString (Escape) - (NSString *)urlEncode; - (NSString *)urlDecode; - (NSString *)escapeHtml; - (NSString *)unescapeHtml; @end #import "NSString+Escape.h" @implementation NSString (Escape) - (NSString *)escapeHtml { NSMutableString *string = [[self mutableCopy] autorelease]; [string replaceOccurrencesOfString:@"&" withString:@"&" options:NSLiteralSearch