Re: CFXMLCreateStringByUnescapingEntities() bombs on "�"
Re: CFXMLCreateStringByUnescapingEntities() bombs on "�"
- Subject: Re: CFXMLCreateStringByUnescapingEntities() bombs on "�"
- From: Quincey Morris <email@hidden>
- Date: Tue, 25 Mar 2014 11:23:58 -0700
On Mar 25, 2014, at 11:12 , Jens Alfke <email@hidden> wrote:
> Now, what method/function should we use to validate that an NSString actually contains valid Unicode code points?
This may have been intended as a rhetorical question, but I’d suggest -[NSString dataUsingEncoding:allowLossyConversion:], specifying ‘NSUnicodeStringEncoding’ and NO for the parameters.
Pragmatically, Jerry also discovered that -[NSString UTF8String] serves as a validation check. (It returned nil.)
_______________________________________________
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