View Issue Details

IDProjectCategoryView StatusLast Update
0003607Far ManagerFindFilespublic2018-05-17 09:02
Reporteruwe-sieber Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx64OSWindowsOS Version7
Product Version3.0 
Summary0003607: Search for Unicode text in binary files unreliable
Description
FAR's "Find file", "Containting text" does not always find binary files even they contain the text searched for as UTF-16 text.
Steps To ReproduceThe attached XLS file contains two filled cells with "Bart" and "Lisa".
FAR finds the file if then searched text is "Lisa" but it does not find the file if searched text is "Bart".
"Bart" starts at 0x92F, "Lisa" at 0x93A.

I've tried "Unicode (Little endian)" and "Automatic detection".
TagsSearch
Build

Activities

uwe-sieber

2018-05-15 09:54

reporter  

bart_lisa.xls (9,728 bytes)

DrKnS

2018-05-15 10:39

administrator   bugnote:0016111

> "Bart" starts at 0x92F, "Lisa" at 0x93A.

That's the reason.
0x92f is 2351, an odd number.
UTF-16 search simply interprets your file as a sequence of 16-bit codepoints, each of them has an even address by definition.

So from this perspective the file does not contain "Bart" (0042 0061 0072 0074), but contains "䈁愀爀琀" (4201 6100 7200 7400).

shmuel

2018-05-15 10:52

developer   bugnote:0016112

Last edited: 2018-05-15 10:52

But why it doesn't find Lisa?

JohnDoe

2018-05-15 11:31

updater   bugnote:0016113

But why it doesn't find Lisa?

shmuel
It does

shmuel

2018-05-15 11:39

developer   bugnote:0016114

Sorry did not read carefully enough.

uwe-sieber

2018-05-16 16:36

reporter   bugnote:0016115

I think even the codepage is a 16 Bit format the search should just look for the byte sequence. False positives seem to be very unlikely, at least if the seach text isn't too short...

DrKnS

2018-05-16 22:28

administrator   bugnote:0016116

Ok, let's say we implement it.
Presumably your next ticket will be "Search finds 'Bart' in the file, but neither Viewer nor Editor show it in any code page"?

uwe-sieber

2018-05-17 09:02

reporter   bugnote:0016120

No, this is about search in binary files. The Editor are strictly for text files, the viewer shows the byte sequence in hex view.

Issue History

Date Modified Username Field Change
2018-05-15 09:54 uwe-sieber New Issue
2018-05-15 09:54 uwe-sieber File Added: bart_lisa.xls
2018-05-15 09:54 uwe-sieber Tag Attached: Search
2018-05-15 10:39 DrKnS Note Added: 0016111
2018-05-15 10:52 shmuel Note Added: 0016112
2018-05-15 10:52 shmuel Note Edited: 0016112
2018-05-15 11:31 JohnDoe Note Added: 0016113
2018-05-15 11:39 shmuel Note Added: 0016114
2018-05-16 16:36 uwe-sieber Note Added: 0016115
2018-05-16 22:28 DrKnS Note Added: 0016116
2018-05-17 09:02 uwe-sieber Note Added: 0016120