Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Using WebKit to encode unescaped URL strings
- (NSURL)URLFromString:(NSString *)string;
static NSPasteboard *pboard;
if (!pboard) pboard = [[NSPasteboard pasteboardWithUniqueName] retain];
[pboard clearContents];
[pboard writeObjects:@[string]];
NSURL *result = [WebView URLFromPasteboard:pboard];
return result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment