mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 01:09:50 +01:00
tools: iconvtable: fill up empty places to create lossless mapping
git-svn-id: trunk@42030 -
This commit is contained in:
parent
49c1e4f62c
commit
a4c14f88b5
@ -117,6 +117,7 @@ var
|
||||
CharLen: integer;
|
||||
j: Integer;
|
||||
TableIndex: LongInt;
|
||||
k: Integer;
|
||||
begin
|
||||
// single byte to UTF-8
|
||||
if ParamCount=0 then
|
||||
@ -146,6 +147,25 @@ begin
|
||||
end;
|
||||
end;
|
||||
SL.Free;
|
||||
// fill up table
|
||||
if ToEncoding='UTF-8' then begin
|
||||
for i:=33 to 255 do begin
|
||||
if Table[i]<>'' then continue;
|
||||
j:=i;
|
||||
k:=255;
|
||||
s:=UnicodeToUTF8(j);
|
||||
while (k>32) do begin
|
||||
if Table[i]<>s then
|
||||
dec(k)
|
||||
else begin
|
||||
inc(j);
|
||||
s:=UnicodeToUTF8(j);
|
||||
k:=255;
|
||||
end;
|
||||
end;
|
||||
Table[i]:=s;
|
||||
end;
|
||||
end;
|
||||
CreateSortedTable;
|
||||
|
||||
// write table: char to shortstring
|
||||
|
||||
Loading…
Reference in New Issue
Block a user