Reputation: 21147
I am using the base64 implementation at the bottom of this post.
If I use following code:
NSLog(@"decoded:%@",[[[NSString alloc] initWithData:[Base64 decode:@"8fEmIzEyNDA3OyYjMTI0MTE7"] encoding:NSUTF8StringEncoding] autorelease]);
I get decoded:(null)
However, if I use:
NSLog(@"decoded 1:%@",[[[NSString alloc] initWithData:[Base64 decode:@"8fEmIzEyNDA3OyYjMTI0MTE7"] encoding:NSASCIIStringEncoding] autorelease]);
I get decoded:ññぷほ
But I should get decoded:ññぷほ
What am I doing wrong?
Upvotes: 1
Views: 6897
Reputation: 926
You should read this article by Matt Gallagher. At the bottom there is link with code for iOS if that is what you are after.
It provides an class extension to NSData which is you string is easily converted from and too.
Upvotes: 0
Reputation: 799420
Those are HTML character references. You'll need to decode further if you want raw text.
Upvotes: 2