Converting an HTML source string to a readable string
Converting an HTML source string to a readable string
- Subject: Converting an HTML source string to a readable string
- From: Eric Morand <email@hidden>
- Date: Fri, 12 May 2006 08:28:18 +0200
Hi List !
I'm currently trying to parse the content of an HTML source using its
URL. Here is the method I'm using :
MyString = [NSString stringWithContentsOfURL:[NSURL
URLWithString:@"http://www.gamekult.com/communaute/chat/"]];
I don't want to use any function exclusive to 10.4 (because my app
muste be compatible with 10.3), that's why I don't use
stringWithContentsOfURL:enconding:error:
The problem is that part of the HTML source contains caracters like
é (equivalent to "é") and I don't know how to interpret them
correctly to display them to the user.
I've tried to convert the string with various encoding, using :
MyString = [NSString stringWithContentsOfURL:[NSURL
URLWithString:@"http://www.gamekult.com/communaute/chat/"]];
NSData * data = [MyString dataUsingEncoding:NSUnicodeStringEncoding
allowLossyConversion:YES];
MyString = [[NSString alloc] initWithData:data
encoding:NSUnicodeStringEncoding];
But it doesn't change anything.
Is there a way to convert that kind of caracters so it is human
readable ?
Thanks,
Eric. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden