• 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
Problem with CFXMLCreateStringByEscapingEntities to replace special xml chars?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with CFXMLCreateStringByEscapingEntities to replace special xml chars?


  • Subject: Problem with CFXMLCreateStringByEscapingEntities to replace special xml chars?
  • From: Benjamin Levy <email@hidden>
  • Date: Sun, 17 Oct 2004 00:58:43 -0400

Hello,
I've used CFXMLCreateStringByUnescapingEntities before with no problems, but I'm getting a consistent but unexpected result with CFXMLCreateStringByEscapingEntities now that I'm using it for the first time. It seems that the returned string only includes up to the last replaced entity and cuts the rest of the string out and if there are no entities it returns an empty string.

NSString* a = @"one < two";
NSString* b = (NSString*)CFXMLCreateStringByEscapingEntities( kCFAllocatorDefault, (CFStringRef)a, NULL );
NSLog( @"String \"%@\" became \"%@\"", a, b );

Results in: String "one < two" became "one &lt;"

Not much comes up when searching for CFXMLCreateStringByEscapingEntities, but is this a known behavior and/or bug? Am I somehow doing something wrong here?

Thanks for any thoughts or help,
Ben Levy

_______________________________________________
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
  • Prev by Date: Re: DOs and firewalls
  • Next by Date: How to create a background app
  • Previous by thread: [ANN] iURL 1.3 BETA 6 available
  • Next by thread: How to create a background app
  • Index(es):
    • Date
    • Thread