Canonical URL

Discussion in 'Mac Programming' started by McBgnr, May 28, 2009.

  1. macrumors regular

    Joined:
    Apr 13, 2009
    #1
    Hello,

    I wanted to extract the URL from cookes.plist (Safari). However the value for the cookie has some special characters. Thus as it is, this value cannot be used with the browser. How can I convert the value to canonical form so that I can use it for opening in a browser. I had tried using [NSURLProtocol canonicalRequestforRequest], but it did not work :-(

    Suggestions are welcome.
     
  2. thread starter macrumors regular

    Joined:
    Apr 13, 2009
    #2
    Hello,

    I came across a function stringByReplacingPercentEscapesUsingEncoding:
    However when I tried using it as in

    Code:
    NSString* imageUrl = @"http://www.myurl.com/image.jpg";	
    NSString* mapUrl = [imageUrl stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
    
    I am getting compile error saying:
    error: syntax error at the end of input
    warning:'@end' missing in implementation context

    Any idea what this means.
     
  3. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #3
    Most likely you have either not put @end at the end of your class definition or have failed to close a {} bracket set somewhere...
     
  4. thread starter macrumors regular

    Joined:
    Apr 13, 2009
    #4
    Oops... it was a missing closing brace.

    Thanks for the helpful reply. Solved no :)
     

Share This Page