First, thanks for the great library :-)
I think i found a bug in parsing JSON responses using the response encoding.
Afaik this is done in 2 steps, first parsing the responseString into a unicode using the response encoding.
Second parsing the JSON out of the responseString unicode.
According to the Apple spec (https://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html), data given to [NSJSONSerialization JSONObjectWithData:..] must be encoded with one of UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE.
Anything else won't work afaik.
The current code is using the response encoding for building the NSData from the responseString, so parsing JSON from an URI which uses an encoding other than the 5 listed above will fail (e.g. ISO-8859-1).
The responseString is already a unicode, so I think hardcoding the encoding here to UTF-8 won't harm anything and fixes problems when the response encoding is not one of the by NSJSONSerialization supported ones.
fix: JSONData MUST always be encoded using UTF8 according to the appl…
Seems like this might be an alternate solution to #862
This appears to be the right solution. Thanks for the patch. This has been merged in with 205a8aa.