Re: HTML-encoded characters mucking up my NSStrings
Re: HTML-encoded characters mucking up my NSStrings
- Subject: Re: HTML-encoded characters mucking up my NSStrings
- From: Kyle Moffett <email@hidden>
- Date: Tue, 10 Feb 2004 19:15:23 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Feb 10, 2004, at 18:22, Dustin Voss wrote:
CFStringRef unescapedCF = CFXMLCreateStringByUnescapingEntities (NULL,
(CFStringRef) htmlString, NULL);
NSString *unescaped = [NSString stringWithString: (NSString *)
unescapedCF];
CFRelease (unescapedCF);
Why bother with the extra string? CFStringRef and NSString * are
Toll-Free bridged
NSString *noEntities = (NSString
*)CFXMLCreateStringByUnescapingEntities (NULL,
(CFStringRef)withEntities, NULL);
Note, noEntities is *not* autoreleased, you need to autorelease or
release it when done.
Cheers,
Kyle Moffett
- -----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++: a17 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$
L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+
PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r
!y?(-)
- ------END GEEK CODE BLOCK------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFAKXRB+9lumGKBuiIRArpRAJ9o2RMMjFRQnuJ1dUHGYMsFxedmfwCbB3GQ
CtvWzisBF02Z1wdJV7cdJ24=
=ZHOz
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.