You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2013/07/02 18:40:05 UTC

git commit: [CB-4033] Relaxed case-sensitivity of "UTF-8".

Updated Branches:
  refs/heads/master 39be67518 -> d644b0aa5


[CB-4033] Relaxed case-sensitivity of "UTF-8".

FileReader.readAsText previously did not accept, for example, "utf-8".

Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/d644b0aa
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/d644b0aa
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/d644b0aa

Branch: refs/heads/master
Commit: d644b0aa542882beb3ee1bc030ca0426d68543f5
Parents: 39be675
Author: Max Woghiren <ma...@gmail.com>
Authored: Tue Jul 2 12:29:15 2013 -0400
Committer: Max Woghiren <ma...@gmail.com>
Committed: Tue Jul 2 12:29:15 2013 -0400

----------------------------------------------------------------------
 src/ios/CDVFile.m | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/d644b0aa/src/ios/CDVFile.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVFile.m b/src/ios/CDVFile.m
index ee4179c..c245ee3 100644
--- a/src/ios/CDVFile.m
+++ b/src/ios/CDVFile.m
@@ -1128,7 +1128,7 @@ NSString* const kCDVAssetsLibraryPrefix = @"assets-library://";
     NSInteger end = [[command argumentAtIndex:3] integerValue];
 
     // TODO: implement
-    if (![@"UTF-8" isEqualToString : encoding]) {
+    if ([@"UTF-8" caseInsensitiveCompare : encoding] != NSOrderedSame) {
         NSLog(@"Only UTF-8 encodings are currently supported by readAsText");
         CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:ENCODING_ERR];
         [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
@@ -1328,8 +1328,8 @@ NSString* const kCDVAssetsLibraryPrefix = @"assets-library://";
     } else if ([argData isKindOfClass:[NSData class]]) {
         [self writeToFile:fullPath withData:argData append:YES callback:callbackId];
     } else {
-       CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Invalid parameter type"];
-      [self.commandDelegate sendPluginResult:result callbackId:callbackId];
+        CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Invalid parameter type"];
+        [self.commandDelegate sendPluginResult:result callbackId:callbackId];
     }
 
 }