View Issue Details

IDProjectCategoryView StatusLast Update
0003607Far ManagerFindFilespublic2018-05-17 08:02
Reporteruwe-sieber Assigned To 
Status newResolutionopen 
Platformx64OSWindowsOS Version7
Product Version3.0 
Summary0003607: Search for Unicode text in binary files unreliable
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".



2018-05-15 08:54


bart_lisa.xls (9,728 bytes)


2018-05-15 09: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).


2018-05-15 09:52

developer   bugnote:0016112

Last edited: 2018-05-15 09:52

But why it doesn't find Lisa?


2018-05-15 10:31

updater   bugnote:0016113

But why it doesn't find Lisa?

It does


2018-05-15 10:39

developer   bugnote:0016114

Sorry did not read carefully enough.


2018-05-16 15: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...


2018-05-16 21: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"?


2018-05-17 08: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 08:54 uwe-sieber New Issue
2018-05-15 08:54 uwe-sieber File Added: bart_lisa.xls
2018-05-15 08:54 uwe-sieber Tag Attached: Search
2018-05-15 09:39 DrKnS Note Added: 0016111
2018-05-15 09:52 shmuel Note Added: 0016112
2018-05-15 09:52 shmuel Note Edited: 0016112
2018-05-15 10:31 JohnDoe Note Added: 0016113
2018-05-15 10:39 shmuel Note Added: 0016114
2018-05-16 15:36 uwe-sieber Note Added: 0016115
2018-05-16 21:28 DrKnS Note Added: 0016116
2018-05-17 08:02 uwe-sieber Note Added: 0016120