msgpack-objectivec icon indicating copy to clipboard operation
msgpack-objectivec copied to clipboard

Add support and options for parsing and packing NSData

Open csaftoiu opened this issue 11 years ago • 1 comments

For my use case I need to ship around raw bytes that aren't utf8-strings. I added support for this.

The default behavior is almost the same: it attempts to parse the bytes into a utf8-string. However, if it fails, it'll raise an exception instead of either returning nil, not adding a key to a dictionary, or raising an exception when trying to add nil to an NSArray.

Additionally you can specify 3 different behaviors: try to parse as string but fallback on NSData, try to parse as string but fallback on NSNull, or always parse as NSData.

csaftoiu avatar Oct 01 '13 03:10 csaftoiu

Any chance of getting this merged into master? It's a significant improvement, and it feels right that this is officially supported.

tomtaylor avatar May 05 '14 10:05 tomtaylor