Re: XML-/HTML-safe formatted output from NSString
Re: XML-/HTML-safe formatted output from NSString
- Subject: Re: XML-/HTML-safe formatted output from NSString
- From: Greg Hoover <email@hidden>
- Date: Mon, 20 Aug 2007 13:59:40 -0700
Anyone aware of a better way to do this other than the
NSAttributedString initWithHTML method? Perhaps some obscure CF
function that replaces ampersand escapes with their unicode
characters for an NSString?
FROM : Scott Anguish
DATE : Wed Oct 30 22:19:45 2002
Ga! You're definitely right! Thanks.. will fix on my side.
On Wednesday, October 30, 2002, at 02:51 PM, Simon Stapleton wrote:
> Scott. I think you meant [_theString length] rather than [self
> length] in the NSMakeRange calls.
>
> Otherwise, it's fine.
>
> Simon
>
> From: Scott Anguish <<email_removed>>
>> - (NSString *)stringByEncodingXMLCharacters
>> {
>> NSMutableString *_theString=[self mutableCopy];
>> [_theString replaceOccurrencesOfString:@"&"
withString:@"&"
>> options:NSLiteralSearch
>> range:NSMakeRange(0, [self
>> length])];
>> [_theString replaceOccurrencesOfString:@"<" withString:@"<"
>> options:NSLiteralSearch
>> range:NSMakeRange(0, [self
>> length])];
>> [_theString replaceOccurrencesOfString:@">" withString:@">"
>> options:NSLiteralSearch
>> range:NSMakeRange(0, [self
>> length])];
>> NSString *_nonMutableVersion=[NSString
>> stringWithString:_theString];
>> [_theString release];
>> return _nonMutableVersion;
>> }
>>
>> @end
>>
> --
> PGP Key Id : 0x50D0698D
> --
> Well, we finally have an indoor toilet. But what new disasters have
> struck the Alpenproject?
> Find out at : <http://www.tufty.co.uk/Move/index.html>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/
listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden