解析off64字符串,在目标c中给出null

时间:2016-01-13 13:29:03

标签: objective-c base64 decoding

我一直在努力将base64字符串解码为utf8字符串但是它给了我null。

以下是代码: -

NSString * base64String2 = @"J42aMAetDEZVjaSiFSHJgV7xHp88mLj92chZ9ifGmypFGTdvGY2GxMAIOp2n4cAheXpPcX8FRo36Pe9aUx35Xr1nk9Q9571weVOq9+zZFzF+ZsxrL0WWDPa7HAoJ2qZ/yW2PLAwPvZSryWnG2vsgn0hSl/ZPg3mO72XFn8sAEblQdyws0Ngh9LmdgvgAP1mzzjJ3oM2E/2dBgBGV35+rE9bmKhsOP38nYKdzZpSWOHQFpHtW/R9IG2+0GUDlFmNhjY2z+R7eMSqqfvDKCriUCxyVbVfbOop/+0s6F9tsLKZna+hv3hKobsI4GARocW4tQ0D6f2gqN84c9mToYhn0FPn4mq4npMrgF6jttkGcEcp4Y4PdPZPlU3p5hO+yOiEYVidSaXoJ5fUWqBddRA/glWe8vOC4Q4WzSpS4MkveQsYlhWUvkGzFMKYj/KIotubClR9CkCb/7WDSj/jvh8OAHJ+HsofHngaTG/8ULrgPC63OwVd/xPzqdjbPciX2t2tacZc3l3ErXKJmwJnYkJIFszrKsqX892Wp3nG9ey2q//D2D/55H94ux/SZqpXHSVn4qMWYSjo5/Y+PtZASjktJj2lGbkPWWGBe0kx7vvSduiRzEGwFBUXfB4fQXXO7S30C5fmER9LeAzQPPcGxNQ62rtpKV2r8FX7NmlHz2Qda7CnBn8BtzSsTy3LmgHp1X2Qn2j/v41/+k7h/4nlJCTDcet6CtbHCs/8w2PhebeQ0tTF5bl/F2RyqZYWoviSe1LkRjDb38FT7+hKEO3yCOZf7ynviZnTNFPcTUk5M9rxSE0oW/bQ28QWqM7h1Laqs24+fFi5/LFLiFq17WMvQL0oa8X2tkvWRHqGivcbApp3wszzdMRyk6YPKA1/PYuec1iM3nvEfNbnAI/emmftJezgMY+BYYoh4beeMRvv3WfVWCvhgvSQTQBBXU5zJ39/kFV8S+rDOAg8ZSE4lpRwm9W5s6w/qi4w7Y8c1K84UiSWTpNlfJo4+VF3Z/YJWlBuphxjSdUbMzVi79mU+cbfaF+xinKjXu22hjD/0hJSZHLx9tHy7Y0ll8gZgRFgeM9xhyMYc4NBsVKfcW2yepwyRsGsV/A==";

NSData *decodedData = [[NSData alloc] initWithBase64EncodedString:base64String2 options:0];
NSString * decodedString = [[NSString alloc] initWithData:decodedData encoding:NSUTF8StringEncoding];
NSLog(@"Decoded String is:::%@", decodedString);

请帮我解决。

我花了很多时间来解决它,但没有用。

0 个答案:

没有答案