0

While decoding,I am getting NSData bytes by decoding a string.I am converting NSData bytes as string:

-(void)decodeAction:(NSString*)str
{

 NSData *data=[NSData base64DataFromString:str];
 NSString *stt=[NSString stringWithFormat:@"%@",data];
 printf("\n stt %s",[stt UTF8String]);

}

Then I am getting the following output:

<4f7c204d 6c204d61 604d6164 61616461 6164616e 24616e20 4d6e204d 6e204d6f 604d6f68 616f6861 6f68616e 28616e>

Barry Wark
  • 107,306
  • 24
  • 181
  • 206
Madan Mohan
  • 8,764
  • 17
  • 62
  • 96
  • Ya. Accept some answers or people will ignore your questions. – Nathan Osman Mar 17 '10 at 04:39
  • Looks like this function is part of the Cocoa XML-RPC Framework (http://github.com/eczarny/xmlrpc/tree/2.2.1). Maybe try looking in the source code there to find a matching decode function. – Tobias Cohen Mar 17 '10 at 05:01

1 Answers1

1

You probably want:

NSString *stt = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

or something along those lines.

Isaac
  • 10,668
  • 5
  • 59
  • 68