Bug 465035

Summary: 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)
Product: [Applications] kate Reporter: fengchen <fengchen.rs>
Component: searchAssignee: KWrite Developers <kwrite-bugs-null>
Status: CONFIRMED ---    
Severity: major CC: christoph, waqar.17a
Priority: NOR    
Version First Reported In: 22.08.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: two test files
attachment-20428-0.html
garbled
opening all files is ok

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.