Browse Source

Fix ios implementation base64 stream reader bug

Ben Hsieh 8 years ago
parent
commit
61282a6646
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/ios/RNFetchBlob/RNFetchBlob.m

+ 1
- 1
src/ios/RNFetchBlob/RNFetchBlob.m View File

143
 - (void)writeEncodeChunk:(NSString *) chunk {
143
 - (void)writeEncodeChunk:(NSString *) chunk {
144
     NSMutableData * decodedData = [NSData alloc];
144
     NSMutableData * decodedData = [NSData alloc];
145
     if([[self.encoding lowercaseString] isEqualToString:@"base64"]) {
145
     if([[self.encoding lowercaseString] isEqualToString:@"base64"]) {
146
-        decodedData = [chunk dataUsingEncoding:NSUTF8StringEncoding];
146
+        decodedData = [[NSData alloc] initWithBase64EncodedData:chunk options:0];
147
     }
147
     }
148
     if([[self.encoding lowercaseString] isEqualToString:@"utf8"]) {
148
     if([[self.encoding lowercaseString] isEqualToString:@"utf8"]) {
149
         decodedData = [chunk dataUsingEncoding:NSUTF8StringEncoding];
149
         decodedData = [chunk dataUsingEncoding:NSUTF8StringEncoding];