Re: NSURL question (not so easy (i think))
Re: NSURL question (not so easy (i think))
- Subject: Re: NSURL question (not so easy (i think))
- From: Sherm Pendley <email@hidden>
- Date: Thu, 30 May 2002 16:28:28 -0400
On Thursday, May 30, 2002, at 03:22 PM, Mamdouh wrote:
>
Try typing this into IE, and woupti, Mail starts, makes a new message,
>
and (badabum) it has all the spaces inside the subject and inside the
>
body!
The fact that IE's error handling manages to correctly interpret a
broken URL should not be interpreted to imply that it's a legal URL; IE
is well known for its loose interpretation of this and other internet
standards.
>
But CFURL/NSURL from inside my app seems not to have support for spaces
>
in urls,
Support for spaces in URLs is not required by the relevant standards.
>
i get an error that says that this is not a valid URL!
The error is correct. Strings that contain spaces are not valid URLs.
>
So my question is:
>
How can i somehow invoke NSURL so it can recive URL4s that have spaces
>
in them???
By encoding the spaces (and other unsafe characters) as required by RFC
1738 - replace them with the correct URL-encoded equivalents; for
spaces, that's " ".
Fortunately, Apple has provided a function that will escape unsafe
characters for you - search the archives for
"CFURLCreateStringByAddingPercentEscapes"
sherm--
Never put off until tomorrow what you can do today. There might be a law
against it by that time.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.