<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Thu, Feb 25, 2021 at 10:47 AM José Mejuto via lazarus <<a href="mailto:lazarus@lists.lazarus-ide.org">lazarus@lists.lazarus-ide.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In fact I think that the whole unit is needed. It has (info for other <br>
readers) 3 classes TMaskUTF8, TMaskAnsi and TMaskUnicode, maybe <br>
TMaskAnsi can be omitted but UTF8 and Unicode should be present. Many <br>
times TMask is used over zillions of strings, converting Unicode to UTF8 <br>
(for UnicodeStrings and WideStrings) is time consuming, much more than <br>
the masking itself in most cases.<br></blockquote><div><br></div><div>UTF8 is also Unicode, one of its encodings.<br></div><div>The name UnicodeString is misleading. It should be UTF16String.</div><div>Please remember our Unicode solution uses UTF-8. It is done by changing the default encoding of AnsiString and triggered by the same LazUTF8 unit that is used by Masks unit. Everything is UTF-8.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I suggest to keep the 3 classes and create a new TMask one which mimic <br>
the behaviour of current TMask, disabling the masking extensions (escape <br>
char, [?],...) which is very simple as you only need to subclass the <br>
Create method, mask compilation happens at first use time, not at <br>
creation time.<br></blockquote><div><br></div><div>I can include the TMaskUnicode class there if you want, although its name is also misleading.</div><div>TMaskAnsi must be left out. It has no use with our Unicode solution.<br></div><div>TMaskUTF8 I have renamed to TMask in my tests. It replaces the current TMask which supports Unicode only partially.<br></div><div>I could make an alias type</div><div>  TMask = class(TMaskUTF8)<br></div><div>but why should I? Basically every String in our Unicode system has UTF-8 encoding. No need to have a special mask class for UTF-8.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
This way current code using TMask will behave 99.9% identical, but an <br>
user that needs to mask other strings can use TMaskUnicode, in example, <br>
and activate or deactivate other extensions.<br></blockquote><div><br></div><div>Where do the other strings come from? Anyway TMaskUnicode can be included, no problem.</div><div>I am not sure we want a new TMask to behave 99.9% identical with the current one. The new one has some clear improvements.<br></div><div>Interestingly there does not seem to be any standard for the mask syntax. So we cannot be compliant to any "standard".</div><div><br></div><div><br></div><div>Regards,</div><div>Juha</div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>