osdir.com
mailing list archive

Subject: Re: NSURL fileURLWithPath doesn't produce a valid URL - msg#01881

List: cocoa-dev

Date: Prev Next Index Thread: Prev Next Index
I'm confused:

NSLog(@"%@", CFURLCreateStringByAddingPercentEscapes(nil,
CFSTR("http://www.example.com?a+b & c = d"), nil, CFSTR("+=&"),
kCFStringEncodingUTF8));

That doesn't do what you want?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/maillists%40codeha.us

This email sent to maillists@xxxxxxxxx

Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: NSURL fileURLWithPath doesn't produce a valid URL

On 31.07.2009, at 14:02, Richard Frith-Macdonald wrote: Why do you think that's not a valid URL? It's because another code (Flash plugin) doesn't want to work if I provide a path (as a part of URL), containing "+" characters. At least I don't see other reasons, why the same function work for path with my home directory, and doesn't work with path, provided by _CS_DARWIN_USER_DIR. If you look at RFC1738 you will see it explicitly says that a '+' is allowed. Say it to Macromedia... or to Adobe?... Though I work with Flash directly (not by WebKit), so maybe the error is within my code, I leave such chance. Nevertheless, even in that case the error is just in the need of URL encoding, as I believe. I suspect what you are actually looking for is a mechanism to encode a string for use as a field name or field value in a form encoded as the query string of a URL. If thats the case, you need to encode the '+' '=' and '&' characters yourself. I was just about that. I've created a simple function, encoding necessary characters - blanks, pluses, etc., but I just would like to know if there is a standard way to do it by API usage. But you say - "do it yourself". Therefore I believe, the question is closed. Isn't it? Thanks. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/maillists%40codeha.us This email sent to maillists@xxxxxxxxx

Next Message by Date: click to view message preview

Re: Diagramming (a bit OT)

Thanks guys. On 31/07/2009, at 6:07 PM, WT wrote: Hi Loukas, there was an almost identical thread here a couple of months ago, with several responses. You might want to search the list archives and see if there are suggestions there that you might like. Wagner On Jul 31, 2009, at 5:19 AM, Loukas Kalenderidis wrote: Hey guys, Sorry, this is a bit off topic for this list, but I'm mostly interested in responses from Cocoa people so please bear with me. What do you use for technical diagramming for everything in the software development realm? I use OmniGraffle, but most of my work is pretty informal because I (regrettably now) avoided most of the boring-looking UML/etc courses at uni. Does anybody have some good resources for learning how this stuff is supposed to be done formally? Does anybody know what tool/templates/etc Apple might use for the diagrams in their technical documentation? e.g. http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Art/token_generation.jpg Thanks, Loukas _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/maillists%40codeha.us This email sent to maillists@xxxxxxxxx

Previous Message by Thread: click to view message preview

Re: NSURL fileURLWithPath doesn't produce a valid URL

On 31.07.2009, at 14:02, Richard Frith-Macdonald wrote: Why do you think that's not a valid URL? It's because another code (Flash plugin) doesn't want to work if I provide a path (as a part of URL), containing "+" characters. At least I don't see other reasons, why the same function work for path with my home directory, and doesn't work with path, provided by _CS_DARWIN_USER_DIR. If you look at RFC1738 you will see it explicitly says that a '+' is allowed. Say it to Macromedia... or to Adobe?... Though I work with Flash directly (not by WebKit), so maybe the error is within my code, I leave such chance. Nevertheless, even in that case the error is just in the need of URL encoding, as I believe. I suspect what you are actually looking for is a mechanism to encode a string for use as a field name or field value in a form encoded as the query string of a URL. If thats the case, you need to encode the '+' '=' and '&' characters yourself. I was just about that. I've created a simple function, encoding necessary characters - blanks, pluses, etc., but I just would like to know if there is a standard way to do it by API usage. But you say - "do it yourself". Therefore I believe, the question is closed. Isn't it? Thanks. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/maillists%40codeha.us This email sent to maillists@xxxxxxxxx

Next Message by Thread: click to view message preview

Re: NSURL fileURLWithPath doesn't produce a valid URL

On 31.07.2009, at 14:57, Dave Keck wrote: I'm confused: NSLog(@"%@", CFURLCreateStringByAddingPercentEscapes(nil, CFSTR("http://www.example.com?a+b & c = d"), nil, CFSTR("+=&"), kCFStringEncodingUTF8)); That doesn't do what you want? I've misunderstood. It was said "do it yourself" in the previous answer, but not "use CFURLCreateStringByAddingPercentEscapes with the necessary characters, included into the fourth argument", so I thought this function doesn't do what I need. Of course, I was not too careful when I read its description, where it was said, that fourth argument is just for my case. Thanks. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/maillists%40codeha.us This email sent to maillists@xxxxxxxxx
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by