No obvious way to encode/decode HTML entities in NSString
| Originator: | friedrich.markgraf | ||
| Number: | rdar://13059972 | Date Originated: | |
| Status: | Resolved: | ||
| Product: | iPhone SDK | Product Version: | all |
| Classification: | Feature (New) | Reproducible: | Always |
Summary: I see no obvious way of transforming an NSString with characters that need to be encoded as HTML Entities, or vice versa (a string containing encoded HTML entities that need to be decoded into ordinary characters). For example, '&' or '>' or 'ü' need to be transformed into '&', '>' and 'ü' respectively - or their respective numeric values. And of course need to be decodable as well. Steps to Reproduce: 1. Have NSString @"Äpfel > Birnen" 2. Try to somehow convert this to @"Äpfel > Birnen" 3. fail to find any built-in methods in Cocoa Touch. Reverse steps 1 and 2 for conversion the other way around. Step 3 remains unchanged. Expected Results: The general awesomeness of NSString and the accompanying string frameworks made me expect this relatively basic functionality to be included. Actual Results: Wasted time having to write or find something for this presumably common problem myself. Regression: n/a Notes: n/a
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!