diff --git a/ChangeLog b/ChangeLog index 02f4d1cbf..3295edc19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-06-06 Richard Frith-Macdonald + + * Source/NSURL.m: ([initWithScheme:host:path:]) escape characters in + path as required. + 2006-06-04 Richard Frith-Macdonald * Source/NSIndexPath.m: diff --git a/Source/NSURL.m b/Source/NSURL.m index 57f36cc3f..c732f2c99 100644 --- a/Source/NSURL.m +++ b/Source/NSURL.m @@ -518,7 +518,9 @@ static unsigned urlAlign; /** * Initialise by building a URL string from the supplied parameters - * and calling -initWithString:relativeToURL: + * and calling -initWithString:relativeToURL:
+ * This method adds percent escapes to aPath if it contains characters + * which need ascaping. */ - (id) initWithScheme: (NSString*)aScheme host: (NSString*)aHost @@ -526,6 +528,8 @@ static unsigned urlAlign; { NSString *aUrlString = [NSString alloc]; + aPath + = [aPath stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; if ([aHost length] > 0) { if ([aPath length] > 0)