• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Converting an HTML source string to a readable string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 &#233; (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
  • Follow-Ups:
    • Re: Converting an HTML source string to a readable string
      • From: j o a r <email@hidden>
  • Prev by Date: Re: NSDrawer in System Pref Pane
  • Next by Date: connecting open-print-save-quit... to methods
  • Previous by thread: For the Good of the List
  • Next by thread: Re: Converting an HTML source string to a readable string
  • Index(es):
    • Date
    • Thread