]> git.saurik.com Git - cydia.git/commitdiff
Fix various forms of icon escape encoding.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 10 Mar 2011 06:14:32 +0000 (22:14 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 10 Mar 2011 06:14:32 +0000 (22:14 -0800)
MobileCydia.mm

index de34030badb12104fcc090a1f639410200c035bc..ab82735485301efb246aab39a3249acd4fe5a345 100644 (file)
@@ -2606,14 +2606,12 @@ struct PackageNameOrdering :
     if (parsed_ != NULL)
         if (NSString *href = parsed_->icon_)
             if ([href hasPrefix:@"file:///"])
-                // XXX: correct escaping
-                icon = [UIImage imageAtPath:[href substringFromIndex:7]];
+                icon = [UIImage imageAtPath:[[href substringFromIndex:7] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
     if (icon == nil) if (section != nil)
-        icon = [UIImage imageAtPath:[NSString stringWithFormat:@"%@/Sections/%@.png", App_, section]];
+        icon = [UIImage imageAtPath:[NSString stringWithFormat:@"%@/Sections/%@.png", App_, [section stringByReplacingOccurrencesOfString:@" " withString:@"_"]]];
     if (icon == nil) if (Source *source = [self source]) if (NSString *dicon = [source defaultIcon])
         if ([dicon hasPrefix:@"file:///"])
-            // XXX: correct escaping
-            icon = [UIImage imageAtPath:[dicon substringFromIndex:7]];
+            icon = [UIImage imageAtPath:[[dicon substringFromIndex:7] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
     if (icon == nil)
         icon = [UIImage applicationImageNamed:@"unknown.png"];
     return icon;