• 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
Re: XML-/HTML-safe formatted output from NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:@"&amp;"
>> options:NSLiteralSearch
>> range:NSMakeRange(0, [self
>> length])];
>> [_theString replaceOccurrencesOfString:@"<" withString:@"&lt;"
>> options:NSLiteralSearch
>> range:NSMakeRange(0, [self
>> length])];
>> [_theString replaceOccurrencesOfString:@">" withString:@"&gt;"
>> 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


  • Prev by Date: NSTokenField, Bindings and Pasteboard Operations
  • Next by Date: Pull-down menu styles
  • Previous by thread: Re: Pull-down menu styles
  • Next by thread: Binding NSMenuItem 1 to 1
  • Index(es):
    • Date
    • Thread