I have a piece of NSString that will read "Test & Test" or with "
Is there any way without searching and replacing to make that display as "&" or """ ??
I have a piece of NSString that will read "Test & Test" or with "
Is there any way without searching and replacing to make that display as "&" or """ ??
Hi,
The html string you read is bad formated.
Try to read as UTF-8 or any other formatting in order to get the correct text from the html you're reading.
Can you actually post the code where you read the NSString from the HTML content ?
Adrian
Hi,
Can you try this ?
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.mypage.com/content.html"]]];
[request setHTTPMethod:@"GET"];
NSHTTPURLResponse* authResponse;
NSError* authError;
NSData * authData = [NSURLConnection sendSynchronousRequest:request returningResponse:&authResponse error:&authError];
NSString *authResponseBody = [[NSString alloc] initWithData:authData encoding:NSUTF8StringEncoding];
NSLog(@" Nice Result: %@", authResponseBody);
Adrian
CFXMLCreateStringByUnescapingEntities should do it. Thanks to the magic of toll free bridging you can just use your NSString.