From 205a8aa7e3da2cece0491f41dfb89b3cb267ee11 Mon Sep 17 00:00:00 2001 From: Sebastian Utz Date: Sat, 6 Apr 2013 15:42:10 +0200 Subject: [PATCH] Only encode JSON with UTF8, following recommendation of NSJSONSerialization documentation Signed-off-by: Mattt Thompson --- AFNetworking/AFJSONRequestOperation.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AFNetworking/AFJSONRequestOperation.m b/AFNetworking/AFJSONRequestOperation.m index 008aacc..ac7423a 100644 --- a/AFNetworking/AFJSONRequestOperation.m +++ b/AFNetworking/AFJSONRequestOperation.m @@ -75,7 +75,7 @@ static dispatch_queue_t json_request_operation_processing_queue() { } else { // Workaround for a bug in NSJSONSerialization when Unicode character escape codes are used instead of the actual character // See http://stackoverflow.com/a/12843465/157142 - NSData *JSONData = [self.responseString dataUsingEncoding:self.responseStringEncoding]; + NSData *JSONData = [self.responseString dataUsingEncoding:NSUTF8StringEncoding]; self.responseJSON = [NSJSONSerialization JSONObjectWithData:JSONData options:self.JSONReadingOptions error:&error]; }