2

This question may seem silly, but i have been trying to solve it for some time. Any help is appreciated. This is how a part of my response json:

{
            code = CAD;
            country = Canada;
            "currency_id" = 3;
            "symbol" = "$";
        },
                {
            code = CZK;
            country = "Czech Republic";
            "currency_id" = 4;
            "symbol" = "K\\xc4\\x8d";
        },...

The "symbol" field is my headache.

NSString *string = @"K\\xc4\\x8d";
const char *utf8string = [string UTF8String];
NSString *encodeString = [NSString stringWithUTF8String:utf8string];
NSLog(@"convertedString: %@", encodeString);

This code does not seem to work. It prints 'K\xc4\x8d'.

Please advice me how can I get the desired out put , ie, "" ?

Thanks in advance.

Rojil Thomas
  • 309
  • 4
  • 11
  • I've just tried both those bits of code and they produce the correct result. – Guy Kogus May 12 '14 at 08:49
  • refer this link http://stackoverflow.com/questions/23538573/nsstring-md5-with-hash/23538934#23538934 – karthikeyan May 12 '14 at 08:54
  • @GuyKogus The same for me. Both variants works. – Avt May 12 '14 at 09:08
  • 1
    It seems to work for me too now when i tried in a fresh project. I don't know what happened previously. But my actual problem is while trying to get the value of the exact string from the json , ie, "**K\\xc4\\x8d**". I'll edit the question in that manner. – Rojil Thomas May 12 '14 at 09:23

0 Answers0