[OGo-Developer] NSURL different in libFoundation and GNUstep base?
Helge Hess
developer@opengroupware.org
Sun, 13 Apr 2008 17:26:56 +0200
On 13.04.2008, at 16:41, Sebastian Reitenbach wrote:
>> lF itself has no HTTP support. You can use WOHTTPConnection,
>> WORequest, WOResponse.
> what a mess, then i need to look at these classes...
The HTTP API of Foundation was reworked quite a few times, the WO
classes have always been the most stable option.
>> Because your escaping code is b0rked. You escape almost the whole
>> URL:
>>
>> URLString = [URLString stringByEscapingURL];
>> URLString = [@"http://" stringByAppendingString:URLString];
>>
>> How is that supposed to work? (you put everything in the
>> hostname ...)
> at least that stringByAddingPercentEscapesUsingEncoding worked for
> me on the
> whole uri string in gnustep-base, I did assume something equivalent
> happen
> with stringByEscapingURL.
This would be a major bug in GNUstep, which is quite unlikely. As
mentioned the whole approach is utterly wrong. It is more likely that
stringByAddingPercentEscapesUsingEncoding only encodes a subset and is
not a proper URL fragment encoder.
> so I just added the stringByAddingPercentEscapesUsingEncoding to
> NSString+URLEscaping.m. (cut 'n paste from gnustep), works now on
> the whole
> string, the same way as in gnustep ;).
It does not really work.
> I could also add the stringByReplacingPercentEscapesUsingEncoding,
> and then
> open an enhancement request, including a patch. As both libraries have
> compatible licenses, I think that shouldn't be too much a problem.
> However, in gnustep-base, these methods are found in NSString.m,
> where would
> be the best place in libFoundation?
libFoundation is BSD license, we can't include GS code. If you want to
write portable code, just use the methods provided by NGExtensions.
They also do the proper thing.
Helge
--
Helge Hess
http://www.helgehess.eu/