Apologies if this has been answered already. There are similar topics but none that I could find pertaining to Cocoa & NSStrings...
I'm constructing a clickable URL to embed in an HTML email to be sent via the MFMailComposeViewController
on the iPhone. i create the url then use stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding
to polish up white space, etc. then add some surrounding HTML to get:
<a href = "http://www.site.com/viewitem?name=Johnny%20Rotten&age=53&mate=sid%20vicious">view</a>
All's well so it's appended to emailBody. However once [mailComposer setMessageBody:emailBody isHTML:YES]
all the &
become &
which isn't ideal within my URL.
can i control this? is there a better encoding algorithm? my HTML is a bit rusty perhaps I'm using the wrong encoding? I'm sure on the server I could parse the &
back into &
but looking for the Cocoa way...
Thanks!