On Sun, Nov 16, 2025 at 9:44?PM Fl?vio Etrusco via lazarus <
Show quoted text 9 lines
The 2 removed IsAscii functions were local, only visible in their own units. LazUtf8 had a public IsPureAscii in addition to a local IsAscii. Yes, maybe IsAscii is a better name. IsPureAscii should be an alias and deprecated then.
Unit Pas2jsFileUtils in FPC sources has a similar IsASCII. For some reason it has 2 implementations depending on Pas2js define. I guess Pas2js cannot handle pointers. They both do the same thing anyway.
function IsASCII(const s: string): boolean; inline;
{$IFDEF Pas2js}
var
i: Integer;
begin
for i:=1 to length(s) do
if s[i]>#127 then exit(false);
Result:=true;
end;
{$ELSE}
var
p: PChar;
begin
if s='' then exit(true);
p:=PChar(s);
repeat
case p^ of
#0: if p-PChar(s)=length(s) then exit(true);
#128..#255: exit(false);
end;
inc(p);
until false;
end;
{$ENDIF}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20251116/903aad27/attachment.htm>