[Lazarus] unit Masks vs. unit FPMasks

Bart bartjunk64 at gmail.com
Wed Feb 24 11:58:57 CET 2021

On Wed, Feb 24, 2021 at 11:22 AM José Mejuto via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

> In my code there is non 100% unicode compatibility when using the
> "CaseInsensitive" mode as as it uses lowercase mask and lowercase string
> to perform the test which is wrong by definition

Currently Masks unit does the same.

> And also define if a compatibility break is a bug in the new code or in
> the old code. In example my mask supports (there is a define to disable)
> "[z-a]" converting it to "[a-z]" which is a compatibility break. Also
> there is the support (also can be disabled) for the mask "[?]" which is
> the counterpart for "*" but with one char position.

Current behaviour of sets and wildcards should not be changed by default.
E.g. TShellTreeView and TShellListView us the Masks unit to populate
the tree/view.
An option to have the behaviour you described would be OK, the
TMaskOption can be extended for that.

Sometimes I wish we would migrate to using UnicodeString by default.
It would make life a bit easier.
(And yes I know you would have to deal with composed characters
(grapheme defined by more than 1 16-bit word)).

> > There are no tests for MatchesWindowsMask() yet.
I tested that extensively on my machine with all scenarios I could think of.
But others most likely can think of scenarios I did not test.
It was based on current behaviour of Windows NT platform (Win7 at the
time to be precise).

> Who defines which are right and which are wrong ?
Well, I did ;-)
(Nobody else bothered at the time, and nobody complained either.)


More information about the lazarus mailing list