diff --git a/src/ios/CDVFile.m b/src/ios/CDVFile.m index 59e7d640..570bc457 100644 --- a/src/ios/CDVFile.m +++ b/src/ios/CDVFile.m @@ -586,8 +586,8 @@ - (void)resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command //encode path with percent escapes -(NSString *)encodePath:(NSString *)path { - NSString *decodedPath = [path stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //decode incase it's already encoded to avoid encoding twice - return [decodedPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + NSString *decodedPath = [path stringByRemovingPercentEncoding:NSUTF8StringEncoding]; //decode incase it's already encoded to avoid encoding twice + return [decodedPath stringByAddingPercentEncodingWithAllowedCharacters:NSUTF8StringEncoding]; } diff --git a/src/ios/CDVLocalFilesystem.m b/src/ios/CDVLocalFilesystem.m index c340ce0c..983325ee 100644 --- a/src/ios/CDVLocalFilesystem.m +++ b/src/ios/CDVLocalFilesystem.m @@ -125,7 +125,7 @@ - (NSString *)filesystemPathForURL:(CDVFilesystemURL *)url - (CDVFilesystemURL *)URLforFullPath:(NSString *)fullPath { if (fullPath) { - NSString* escapedPath = [fullPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + NSString* escapedPath = [fullPath stringByAddingPercentEncodingWithAllowedCharacters:NSUTF8StringEncoding]; if ([fullPath hasPrefix:@"/"]) { return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@%@", kCDVFilesystemURLPrefix, self.name, escapedPath]]; }