Jump to content

Dictionary > Define a word functionality fails to open the relevant page in Dictionary.app when the search term includes an apostrophe [Fixed 4.0.3 b1091 pre-release]


mklement0
 Share

Recommended Posts

E.g., searching for "Dunbar's number" correctly shows the preview of the Dictionary.app article, but submitting the entry in order to display it in Dictionary.app quietly fails - a blank page is shown.

 

Omitting the apostrophe (single quote) - searching for "Dunbar number" - works as expected.

 

Link to comment
Share on other sites

2 hours ago, deanishe said:

This works fine, though (on High Sierra): open 'dict://dunbar%27s%20number'

 

I can confirm it also works on Mojave.


But here’s something interesting. In both Alfred and dict://, dunbar's number (straight quote) fails, but dunbar’s number (curly quote) works.

Link to comment
Share on other sites

Weird. Perhaps some dodgy heuristics in open when figuring out whether/what to URL encode?

 

I've seen it do weird stuff before with URLs that aren't properly escaped. Sometimes they work, sometimes they don't.

 

Link to comment
Share on other sites

Alfred uses [NSURL URLWithString:urlString]; and single quote is considered valid in a query so isn't escaped, returning the URL "dict://dunbar's%20number", so this is a bug in Dictionary.

 

Interestingly, Alfred has a custom fallback encoder which encodes lots more (including single quote) if URLWithString fails. If Dictionary is failing to read a fully encoded URL, it makes me nervous to pass a fully encoded string as it may do something opposite.

Link to comment
Share on other sites

19 minutes ago, Andrew said:

If Dictionary is failing to read a fully encoded URL

 

The URL isn't fully encoded, though. Apostrophe is a reserved character, so it should be encoded here. It appears to be a known issue with Apple's URL-encoding routines.

Link to comment
Share on other sites

  • Andrew changed the title to Dictionary > Define a word functionality fails to open the relevant page in Dictionary.app when the search term includes an apostrophe [Fixed 4.0.3 b1091 pre-release]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...