Convert UTF-8 encoded NSData to NSString

0 votes
1,163 views
asked Sep 2, 2014 by kalpana (3,995 points)

HI

  I have UTF-8 encoded NSData from windows server and I want to convert it to NSString for iPhone. Since data contains characters (like a degree symbol) which have different values on both platforms, how do I convert data to string?

 

 

1 Answer

0 votes
answered Sep 2, 2014 by jonathan (3,105 points)

Hi

  NSString* newStr = [NSString stringWithUTF8String:[theData bytes]];

...