In article <BB8179049668744EF610.0.1.2>,
[email]slavinshearsay.demon.co.uk[/email]localhost (Simon Slavin) wrote:
One likely approach is as follows, though I have not tried it:> I have an NSString. 99% of the time it contains just text.
> Sometimes one or more characters of the string will be encoded
> in HTML, like the following:
> Time for Questions & Answers.
> What's the simplest method I can use to turn this into normal
> text (I assume Unicode) ? There will never be any image or
> link information in the string, just encoded text.
1. Load the NSString into an NSAttributedString, using
NSAttributedString's -initWithHTML:doentAttributes initializer.
2. Follow that by converting the attributed string back to an
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 1.4: Best cleanup yet, gets files other tools miss.