msgpack-objectivec
msgpack-objectivec copied to clipboard
Add support and options for parsing and packing NSData
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.
Any chance of getting this merged into master? It's a significant improvement, and it feels right that this is officially supported.