[Enhancement] Match both straight and curly apostrophe types when searching

Bug #1969926 reported by Noirtier
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

There are two types of apostrophe symbol commonly used in digital works, the more casual straight type ' , and the more formal curly type ’ . Ideally a search should match no matter which type is used. E.g. as things stand currently, if I search my collection for "Gravity’s Rainbow" I get no results, and have to instead search for "Gravity's Rainbow". Obviously this is not a big problem nor very high priority enhancement request. But would be nice to have. It is an easy detail to miss for people wondering why their search might not be working.

Or, rather than just solving this specific example, maybe there is a more general solution which makes the search less sensitive to minor changes in punctuation?

Revision history for this message
Kovid Goyal (kovid) wrote :

If you want to match multiple apostrophes, say so in your search expression.



As for having calibre do it magically, the effort isnt worth it to me,
but patches are most welcome. I will note that searching inside the calibre viewer already does this.

Changed in calibre:
status: New → Won't Fix
Revision history for this message
Noirtier (noirtier) wrote :

OK, no worries. The suggested approach only works if the user happens to have in mind that there are two different apostrophes, which doesn't strike me as the sort of thing most people will think of. But thanks for clarifying the search expression for that all the same. ☺

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Won't Fix → Fix Released
Revision history for this message
Jim Miller (retiefjimm) wrote :

Is there a way to suppress this new behavior in search string?

SmartEject plugin, by default, searches `ondevice:"("` looking for "Main (2 books)" etc for duplicates on device. I assume the 'books' part changes with locale. Search now returns all books in the library.

Or is there a better way to search for duplicates?

Best I've found so far is to change the search to `ondevice:"~\\("`

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1969926

Yes, a regex is the correct way to do it, as you discovered.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.