Bug 149630 - Can't search for single quote character (hex 27)
Summary: Can't search for single quote character (hex 27)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bisected, regression
Depends on:
Blocks: Find-Search
  Show dependency treegraph
 
Reported: 2022-06-20 05:05 UTC by Luke Kendall
Modified: 2022-06-26 14:48 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Doc with apostrophe and single quote (9.21 KB, application/vnd.oasis.opendocument.text)
2022-06-21 02:55 UTC, Michael Warner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kendall 2022-06-20 05:05:22 UTC
You can no longer search for an ascii single quote character: Writer will find the apostrophe ('smart' single close quote) character as well.

I tried to find places where I had a single quote character but couldn't (from pasting in text), and couldn't. I had to use OnlyOffice to find them. (Since there were just three, compared to 3,955 'single close quote' characters.)

Searching for " (hex 22) works, as distinct from (smart) typographical close double quote.

I used to be able to search for this in earlier versions of Writer.
Comment 1 Mike Kaganski 2022-06-20 13:29:22 UTC
(I didn't check myself, but pretty sure that my comment quoted below is relevant).

From https://gerrit.libreoffice.org/c/core/+/105717:

> This looks very wrong itself. It simply disallows the strict search-and-replace
> function. The matching of typographical apostrophe with ASCII one fits very much
> with diacritic-insensitive mode, so it should had been only done in that case.

So - most likely regression after commit d40f2d02df26e216f367b5da3f9546b73f250469
  Author László Németh <nemeth@numbertext.org>
  Date   Thu Nov 12 11:33:05 2020 +0100
    tdf#117643 Writer: fix apostrophe search regression
Comment 2 Michael Warner 2022-06-21 02:55:29 UTC
Created attachment 180856 [details]
Doc with apostrophe and single quote
Comment 3 Michael Warner 2022-06-21 02:57:28 UTC
I confirm this with:
Version: 7.3.1.3 / LibreOffice Community
Build ID: a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 10; OS: Mac OS X 12.3.1; UI render: default; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Searching for apostrophe finds both the apostrophe and the closing single quote. This occurs regardless of whether the diacritic-sensitive option is checked.
Comment 4 Mike Kaganski 2022-06-21 07:02:25 UTC
As László noted in reply to my quoted note, the different kinds of apostrophes are not diacritics. And also regular expressions do search literally.

Note that search for ' in e.g. Chrome highlights all similar symbols.

Two possible options that I see:
1. Introduce a new "similar symbols" checkbox (which would e.g. group ’′׳‎᾿◌́◌́ˈꞌ‏‘’‚‏), make it default.
2. Introduce the same option under existing "Similarity search" option (again, make it default).
Comment 5 V Stuart Foote 2022-06-21 10:57:56 UTC
For OP, any reason you don't use the Find & Replace dialog's 'Other options' -> 'Regular expressions' search for "\u0027", or octal "\0047". 

Both provided by ICU libs and that seem functional and suited to specific ask? 

An additional transliteration mode that László and Mike K. mention in the gerrit link aside, the search dialog still works.
Comment 6 Mike Kaganski 2022-06-21 11:46:43 UTC
(In reply to V Stuart Foote from comment #5)

Note that with regular expressions activated, search for ' also works literally.
Comment 7 Mike Kaganski 2022-06-23 06:51:41 UTC
See also: https://ask.libreoffice.org/t/search-only-for-apostrophe/78870
Comment 8 Michael Warner 2022-06-24 18:08:18 UTC
(In reply to V Stuart Foote from comment #5)
> For OP, any reason you don't use the Find & Replace dialog's 'Other options'
> -> 'Regular expressions' search for "\u0027", or octal "\0047". 
> 
> Both provided by ICU libs and that seem functional and suited to specific
> ask? 

That may be an option for this specific person's particular task, but expecting this to be the go-to solution for the average user is not reasonable, in my opinion. I feel confident in saying that it is a small subset of LO users who know what regular expressions are or would ever think to search for a character using a hex code. This seems to me like more of a workaround than an expected use case for what should be the simple task of finding a specific character (and only that character).  

> 
> An additional transliteration mode that László and Mike K. mention in the
> gerrit link aside, the search dialog still works.

Even if you don't consider this to be a bug, the enhancement proposals Mike K. provides in Comment 4 seem like good usability improvements to me.
Comment 9 LeroyG 2022-06-26 14:48:41 UTC
Reproducible with:
Version: 7.4.0.0.alpha1 (x86) / LibreOffice Community
Build ID: b871abad383583f02eb49c7e49aeae01f6941072
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: es-MX (es_MX); UI: es-ES
Calc: threaded