Skip to content

Commit

Permalink
Merge pull request #353 from Daniel528/ascii-readfile-fix
Browse files Browse the repository at this point in the history
Ensuring ascii file reads do not fall through to else case for UTF-8 reading
  • Loading branch information
RonRadtke authored Jun 23, 2024
2 parents 7b461f3 + 98c8b87 commit ffb197f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,7 @@ - (void)readFile:(NSString *)path
}
if([encoding isEqualToString:@"ascii"]) {
resolve((NSMutableArray *)content);
}
if([encoding isEqualToString:@"base64"]) {
} else if([encoding isEqualToString:@"base64"]) {
resolve([content base64EncodedStringWithOptions:0]);
} else {
resolve([[NSString alloc] initWithData:content encoding:NSUTF8StringEncoding]);
Expand Down

0 comments on commit ffb197f

Please sign in to comment.