FROM : Peter Bierman
DATE : Thu Jul 20 20:41:45 2006
At 10:18 AM -0700 7/20/06, David Dunham wrote:
>On 20 Jul 2006, at 09:36, Douglas Davidson wrote:
>
>>>I'm trying to output a string suitable for using in HTML -- no
>>>troublesome characters like < and >.
>
>>Using NSAttributedString's HTML generation should work, although
>>it's a bit heavyweight if you don't actually want any markup.
>
>So there's no lightweight way to do it? (Other than rolling my own
>list of entities, which seems like reinventing the wheel.)
You can use
CFXMLCreateStringByEscapingEntities()
Given a CFString object containing XML source, returns a CFString
object with the specified XML entities escaped. The standard XML
entities are always replaced.
http://developer.apple.com/documentation/CoreFoundation/Reference/CFXMLTreeRef/Reference/reference.html
-pmb
DATE : Thu Jul 20 20:41:45 2006
At 10:18 AM -0700 7/20/06, David Dunham wrote:
>On 20 Jul 2006, at 09:36, Douglas Davidson wrote:
>
>>>I'm trying to output a string suitable for using in HTML -- no
>>>troublesome characters like < and >.
>
>>Using NSAttributedString's HTML generation should work, although
>>it's a bit heavyweight if you don't actually want any markup.
>
>So there's no lightweight way to do it? (Other than rolling my own
>list of entities, which seems like reinventing the wheel.)
You can use
CFXMLCreateStringByEscapingEntities()
Given a CFString object containing XML source, returns a CFString
object with the specified XML entities escaped. The standard XML
entities are always replaced.
http://developer.apple.com/documentation/CoreFoundation/Reference/CFXMLTreeRef/Reference/reference.html
-pmb
| Related mails | Author | Date |
|---|---|---|
| David Dunham | Jul 20, 06:25 | |
| Douglas Davidson | Jul 20, 18:36 | |
| David Dunham | Jul 20, 19:18 | |
| Douglas Davidson | Jul 20, 20:12 | |
| Peter Bierman | Jul 20, 20:41 | |
| Norman Gray | Jul 21, 00:13 | |
| David Dunham | Jul 21, 00:26 | |
| Norman Gray | Jul 21, 11:40 |






Cocoa mail archive

