-
-
Save pburleson/4079642 to your computer and use it in GitHub Desktop.
Using WebKit to encode unescaped URL strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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