diff --git a/Easydict/App/AppDelegate+EZURLScheme.m b/Easydict/App/AppDelegate+EZURLScheme.m index fb7196f10..33f38332e 100644 --- a/Easydict/App/AppDelegate+EZURLScheme.m +++ b/Easydict/App/AppDelegate+EZURLScheme.m @@ -86,9 +86,12 @@ - (NSString *)extractQueryTextFromURL:(NSURL *)URL { - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; - // PopClip text does not encode #, we need to encode it manually. - urlString = [urlString stringByReplacingOccurrencesOfString:@"#" withString:@"%23"]; - NSURL *URL = [NSURL URLWithString:urlString]; + /** + hello, #girl, good + + We need to encode the URL to avoid JLRoutes routing failures. + */ + NSURL *URL = [NSURL URLWithString:urlString.encode]; // easydict://query?text=good if ([URL.scheme containsString:EZEasydictScheme]) {