Page 1 of 1

findfile - content

PostPosted: April 25th, 2010, 9:17 pm
by rafael castro
hi.

I think I detect an error when searching for content.
specifically in a text file UTF-16 LE
This file contains the word "Database"

well ...
when I search the content "Datatabase" and option is [csoCaseSensitive]
returns True. OK.
when I search the content "datatabase" and options is [csoCaseSensitive]
returns False. OK.

but if the option is []
when I search the content "Datatabase" returns False. ??.
when I search the content "datatabase" returns False. ??.

this is a error?

file here: http://www.rcastro360.com/file.txt

I've tested the component FindFileW and demoW

Thanks.

Delphi 7, XP

Re: findfile - content

PostPosted: April 28th, 2010, 1:03 pm
by rafael castro
Sorry, before I wrote the wrong word

Datatabase is Database
datatabase is database

anyway ... I have confirmed findfile has a bug in the search for content

well ...
when I search the content "Database" and option is [csoCaseSensitive]
returns True. OK.
when I search the content "database" and options is [csoCaseSensitive]
returns False. OK.

but if the option is []
when I search the content "Database" returns False. ??.
when I search the content "database" returns False. ??.

Re: findfile - content

PostPosted: April 30th, 2010, 11:01 am
by Kambiz
Thank you for bringing this bug in my attention.

I fixed the bug and you can download the update from the component's page. The bug was in both Ansi and Unicode versions of the component, and was affecting UTF-8, UTF-16, and ANSI searches.

Re: findfile - content

PostPosted: April 30th, 2010, 8:25 pm
by rafael castro
Thank you for fixing it.
All your components are of high quality.
:-({|=

Re: findfile - content

PostPosted: May 1st, 2010, 6:51 pm
by rafael castro
hi kambiz

a question:
you assume that if the file is ansi, the search phrase is ansi.
if the file is ansi and search phrase is wide ... search -> '???'

For example:
the search string is 副 档 名 and the file is ansi, if the file contains '???' returns true.

:-k

Thanks.

Re: findfile - content

PostPosted: May 10th, 2010, 1:19 pm
by Kambiz
Search is based on the file content, and the search phrase may be converted to Ansi, UTF-16, or UTF-8.