How can I make NSString.stringEncodingForData fail?
How can I make NSString.stringEncodingForData fail?
- Subject: How can I make NSString.stringEncodingForData fail?
- From: Daryle Walker <email@hidden>
- Date: Sun, 29 May 2016 03:23:41 -0400
I'm about to test code that uses this method. My encodings are: ASCII, UTF-8, ISO Latin-1, then MacRoman. I think this covers all potential octet values. My "guard" blocks (I'm using Swift.) are for a 0 return and if the optional returned NSString can't be converted to a String.
Can I cause some fail cases, or is that so unlikely that I should assert on non-zero return and use "!" on the optional?
Sent from my iPhone
_______________________________________________
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