I\'m getting an html file as NSData and need to parse it to extract some info. My approach was to convert it to NSString with UTF8 encoding (the html has non english characters,
Supposing you got a NSURLResponse* response and an NSData* data:
CFStringEncoding cfEncoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef) [response textEncodingName]);
NSStringEncoding encoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding);
NSString* string = [[NSString alloc] initWithData:data encoding:encoding];
// Do stuff here..
[string release];