NSURL and percent escaping

Philippe Roussel <[email protected]> Fri, 22 Aug 2025 15:33:52 +0200
Newsgroups gmane.comp.lib.gnustep.devel
Message-ID <[email protected]>
Hi all,

I'm trying to instanciate NSURL using -initWithScheme:user:password...
method and I'm having trouble when the user needs escaping. I might be
doing something wrong but I don't understand NSURL behaviour...

Here is a simplified example : 

NSURL *url = [[NSURL alloc] initWithScheme:@"http"
                                      user:@"p.o.roussel%40free.fr"
								  password:@"password"
								      host:@"127.0.0.1"
									  port:nil
								  fullPath:@"dav.php/calendars/[email protected]/default/"
						   parameterString:nil
						             query:nil
								  fragment:nil];
											   
When I log [url absoluteString] I get the following

http://p.o.roussel%2540free.fr:[email protected]/dav.php/calendars/[email protected]/default/

and I don't understand the '%2540' part. If I use the original non
escaped username -initWithScheme return nil;

Full example attached, built and run against libgnustep-base.so.1.28.

Any hint ?

Thanks,
Philippe
-- 
Evolution (n): A hypothetical process whereby infinitely improbable events occur with alarming frequency, order arises from chaos, and no one is given credit.