Bug 465035 - Using "Search in Folder", when the search character is a non-English string, the search result only has open files, and it is normal to search for an English string (there are also non-open files in the search result)
Summary: Using "Search in Folder", when the search character is a non-English string, ...
Status: CONFIRMED
Alias: None
Product: kate
Classification: Applications
Component: search (show other bugs)
Version: 22.08.1
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-30 11:20 UTC by fengchen
Modified: 2024-06-16 18:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
two test files (199 bytes, application/x-7z-compressed)
2023-01-30 11:20 UTC, fengchen
Details
attachment-20428-0.html (1.30 KB, text/html)
2023-01-30 11:57 UTC, fengchen
Details
garbled (21.74 KB, image/png)
2023-01-30 15:03 UTC, fengchen
Details
opening all files is ok (22.58 KB, image/png)
2023-01-30 15:10 UTC, fengchen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fengchen 2023-01-30 11:20:12 UTC
Created attachment 155783 [details]
two test files

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Click "Search" in the lower left corner
2. Enter a non-English string in the 'Find' input box, click the third drop-down box on the right and select 'In Folder', click on the double arrow circle on the right (use the current doc's path)
3. Click the 'Search' button,  search results only show currently open files
4.Repeat the second step, this time enter the English string, click 'Search', the search results will include unopened files

OBSERVED RESULT
The search component has a bug when searching for non-English characters

EXPECTED RESULT
Search results for non-English strings should include unopened files in folders

SOFTWARE/OS VERSIONS
Windows:  10 LTSC2021

Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: Version 5.98.0
Qt Version: Version 5.15.5 (built against 5.15.5)

ADDITIONAL INFORMATION
The document encoding of the test is UTF-8, and the non-English characters are '测试'
Comment 1 Waqar Ahmed 2023-01-30 11:32:29 UTC
Can you try with a more recent version of Kate? Latest is 22.12.1
Comment 2 fengchen 2023-01-30 11:57:59 UTC
Created attachment 155784 [details]
attachment-20428-0.html

The test results of Version 22.12.1 and 22.08.1 are the same

Waqar Ahmed <bugzilla_noreply@kde.org> 于2023年1月30日周一 19:32写道:

> https://bugs.kde.org/show_bug.cgi?id=465035
>
> Waqar Ahmed <waqar.17a@gmail.com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |waqar.17a@gmail.com
>
> --- Comment #1 from Waqar Ahmed <waqar.17a@gmail.com> ---
> Can you try with a more recent version of Kate? Latest is 22.12.1
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 fengchen 2023-01-30 15:03:12 UTC
Created attachment 155787 [details]
garbled
Comment 4 fengchen 2023-01-30 15:04:47 UTC
(In reply to fengchen from comment #3)
> Created attachment 155787 [details]
> garbled

I found that when searching for English strings, non-English characters in the results displayed in the search list for non-open files are garbled. When you open all files and search for English strings, there will be no non-English characters garbled
Comment 5 fengchen 2023-01-30 15:10:21 UTC
Created attachment 155790 [details]
opening all files is ok

opening all files is ok
Comment 6 Christoph Cullmann 2024-06-16 18:04:33 UTC
I think the issues is that for non-open files the encoding detection doesn't work as when the file is just loaded by ktexteditor.