1

I'm getting response from server and converting this response to NSDicitonary. My code is as following:

Alamofire.request("MyURL", method: .post, parameters:attributes, encoding: URLEncoding.default, headers: [:]).responseJSON {
            response in                

            switch response.result {
            case .success:

                let swiftyJsonVar = response.result.value!
                do {
                    if let dicObj = swiftyJsonVar as? NSDictionary {
                        print(dicObj)

But my issue is, one of my key having unicode character \u{20b9} and when I convert it to NSDictionary from response.result.value then it add one more slash to unicode character like \\u{20b9}.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sarabjit Singh
  • 1,814
  • 1
  • 17
  • 28
  • The \ character must be backslash escaped. A `NSString` of \ is encoded as the JSON string \\. – TheTiger May 02 '18 at 05:56
  • See [this](https://stackoverflow.com/questions/24609224/remove-backslash-in-objective-c) if it can help you. And this comment `Your problem is that you apparently "serialized" the JSON twice. Fix that, rather than trying to un-muddle things after the deed.` – TheTiger May 02 '18 at 06:01
  • Probably [this answer](https://stackoverflow.com/a/16948785/1140335) will solve your issue. – TheTiger May 02 '18 at 06:04
  • No Success :( . – Sarabjit Singh May 02 '18 at 06:27

0 Answers0