浏览代码

Fix readFile ASCII

Ben Hsieh 9 年前
父节点
当前提交
076b9ef5ec
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6
    6
      src/ios/RNFetchBlobFS.m

+ 6
- 6
src/ios/RNFetchBlobFS.m 查看文件

341
                     resolve([fileContent base64EncodedStringWithOptions:0]);
341
                     resolve([fileContent base64EncodedStringWithOptions:0]);
342
             }
342
             }
343
             else if ([[encoding lowercaseString] isEqualToString:@"ascii"]) {
343
             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
+                }
349
                 if(resolve != nil)
349
                 if(resolve != nil)
350
-                    resolve([[NSString alloc] initWithData:fileContent encoding:NSASCIIStringEncoding]);
350
+                    resolve(@[resultArray]);
351
             }
351
             }
352
         }];
352
         }];
353
     }
353
     }