Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 076b9ef

Browse files
committed
Fix readFile ASCII
1 parent 7d42b66 commit 076b9ef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ios/RNFetchBlobFS.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,13 @@ + (void) readFile:(NSString *)path encoding:(NSString *)encoding
341341
resolve([fileContent base64EncodedStringWithOptions:0]);
342342
}
343343
else if ([[encoding lowercaseString] isEqualToString:@"ascii"]) {
344-
// NSMutableArray * resultArray = [NSMutableArray array];
345-
// char * bytes = [fileContent bytes];
346-
// for(int i=0;i<[fileContent length];i++) {
347-
// [resultArray addObject:[NSNumber numberWithChar:bytes[i]]];
348-
// }
344+
NSMutableArray * resultArray = [NSMutableArray array];
345+
char * bytes = [fileContent bytes];
346+
for(int i=0;i<[fileContent length];i++) {
347+
[resultArray addObject:[NSNumber numberWithChar:bytes[i]]];
348+
}
349349
if(resolve != nil)
350-
resolve([[NSString alloc] initWithData:fileContent encoding:NSASCIIStringEncoding]);
350+
resolve(@[resultArray]);
351351
}
352352
}];
353353
}

0 commit comments

Comments
 (0)