diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 9a1dc66b..2409740c 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -32,7 +32,7 @@ - (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost [appcast setDelegate:self]; NSString *userAgent = [NSString stringWithFormat: @"%@/%@ Sparkle/%@", [aHost name], [aHost displayVersion], ([SPARKLE_BUNDLE objectForInfoDictionaryKey:@"CFBundleVersion"] ?: nil)]; NSData * cleanedAgent = [userAgent dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; - userAgent = [NSString stringWithCString:[cleanedAgent bytes] length:[cleanedAgent length]]; + userAgent = [[NSString alloc] initWithData:cleanedAgent encoding:NSASCIIStringEncoding]; [appcast setUserAgentString:userAgent]; [appcast fetchAppcastFromURL:URL]; } diff --git a/Sparkle/SUHost.m b/Sparkle/SUHost.m index 3f8f91db..90334078 100644 --- a/Sparkle/SUHost.m +++ b/Sparkle/SUHost.m @@ -111,7 +111,7 @@ - (NSString *)publicDSAKey // More likely, we've got a reference to a Resources file by filename: NSString *keyFilename = [self objectForInfoDictionaryKey:SUPublicDSAKeyFileKey]; if (!keyFilename) { return nil; } - return [NSString stringWithContentsOfFile:[bundle pathForResource:keyFilename ofType:nil]]; + return [NSString stringWithContentsOfFile:[bundle pathForResource:keyFilename ofType:nil] encoding:NSASCIIStringEncoding error:NULL]; } - (NSArray *)systemProfile