Fix #89 by encoding paths correctly I hope
This commit is contained in:
parent
5d9cc6faea
commit
dce400435e
3 changed files with 3 additions and 3 deletions
|
@ -62,7 +62,7 @@ static NSString * g_make_unpack_path(NSString * archive, NSString * file, NSStri
|
|||
while ( !fex_done(fex) ) {
|
||||
NSString *name = [NSString stringWithUTF8String:fex_name(fex)];
|
||||
if ([[NSClassFromString(@"AudioPlayer") fileTypes] containsObject:[[name pathExtension] lowercaseString]])
|
||||
[files addObject:[NSURL URLWithString:[g_make_unpack_path([url path], name, @"fex") stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]]];
|
||||
[files addObject:[NSURL URLWithDataRepresentation:[g_make_unpack_path([url path], name, @"fex") dataUsingEncoding:NSUTF8StringEncoding] relativeToURL:nil]];
|
||||
fex_next(fex);
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ void * source_fopen(const char * path)
|
|||
if ( ![[psf_file_container instance] try_hint:[NSString stringWithUTF8String:path] source:&source] )
|
||||
{
|
||||
NSString * urlString = [NSString stringWithUTF8String:path];
|
||||
NSURL * url = [NSURL URLWithString:[urlString stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]];
|
||||
NSURL * url = [NSURL URLWithDataRepresentation:[urlString dataUsingEncoding:NSUTF8StringEncoding] relativeToURL:nil];
|
||||
|
||||
id audioSourceClass = NSClassFromString(@"AudioSource");
|
||||
source = [audioSourceClass audioSourceForURL:url];
|
||||
|
|
|
@ -82,7 +82,7 @@ static STREAMFILE *cogsf_create(id file, const char *path) {
|
|||
|
||||
STREAMFILE *cogsf_create_from_path(const char *path) {
|
||||
NSString * urlString = [NSString stringWithUTF8String:path];
|
||||
NSURL * url = [NSURL URLWithString:[urlString stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]];
|
||||
NSURL * url = [NSURL URLWithDataRepresentation:[urlString dataUsingEncoding:NSUTF8StringEncoding] relativeToURL:nil];
|
||||
|
||||
return cogsf_create_from_url(url);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue