mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 10:59:05 +02:00
lcl: fixed UCS2LEToUTF8 for 1byte niput, issue #33296
git-svn-id: trunk@57429 -
This commit is contained in:
parent
632758d660
commit
9b15983c25
@ -5378,11 +5378,9 @@ var
|
||||
i: Integer;
|
||||
c: Word;
|
||||
begin
|
||||
if s='' then begin
|
||||
Result:=s;
|
||||
exit;
|
||||
end;
|
||||
len:=length(s) div 2;
|
||||
if len=0 then
|
||||
exit('');
|
||||
SetLength(Result,len*3);// UTF-8 is at most 3/2 times the size
|
||||
Src:=PWord(Pointer(s));
|
||||
Dest:=PChar(Result);
|
||||
@ -5410,11 +5408,9 @@ var
|
||||
i: Integer;
|
||||
c: Word;
|
||||
begin
|
||||
if s='' then begin
|
||||
Result:=s;
|
||||
exit;
|
||||
end;
|
||||
len:=length(s) div 2;
|
||||
if len=0 then
|
||||
exit('');
|
||||
SetLength(Result,len*3);// UTF-8 is at most three times the size
|
||||
Src:=PWord(Pointer(s));
|
||||
Dest:=PChar(Result);
|
||||
|
Loading…
Reference in New Issue
Block a user