Something
public text v1 · immutablefunction utf2asc(s:string): string;
var
t:string;
i:integer;
begin
i:=1;
t:='';
while i<=length(s) do begin
if ord(s[i])<128 then t:=t+s[i]
else begin
t:=t+chr(((ord(s[i]) and 3)*64)+(ord(s[i+1]) and 63));
i:=i+1;
end;
if t[length(t)]=#0 then t[length(t)]:=#255;
i:=i+1;
end;
Result:=t;
end;