Re: NSStrings for NSURL URLWithString
Re: NSStrings for NSURL URLWithString
- Subject: Re: NSStrings for NSURL URLWithString
- From: "Louis C. Sacha" <email@hidden>
- Date: Tue, 4 May 2004 18:31:02 -0700
Hello...
If you are targeting 10.3 or later, you can use the NSString instance method
- (NSString
*)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)encoding;
Otherwise, you would need to use the CoreFoundation CFURL function
CFURLCreateStringByAddingPercentEscapes(...) which should always be
available, although you will have to be careful to release the result
(CF functions with Create in the name follow the same memory
management rules as the objC methods alloc and copy).
For the string encoding needed as an argument for these, you would
probably use NSUTF8StringEncoding.
Hope that helps,
Louis
Hi, I did some searching, but no luck. I have an NSString that I
want to use in [NSURL URLWithString:], the problem is, my string
contains the carrot character ("^") which NSURL doesn't like, as
stated in the documentation. Problem is, I don't know how or what I
need to do convert the ^ character to. Can someone help.
Thanks,
Ian _______________________________________________
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.
_______________________________________________
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.