mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 12:12:47 +02:00
lazutils: optimized UTF8CStringToUTF8String
git-svn-id: trunk@34216 -
This commit is contained in:
parent
a5cfbd31e2
commit
4b8a579110
@ -538,7 +538,6 @@ var
|
||||
Source: PChar;
|
||||
Dest: PChar;
|
||||
SourceEnd: PChar;
|
||||
CharLen: integer;
|
||||
SourceCopied: PChar;
|
||||
|
||||
// Copies from SourceStart till Source to Dest and updates Dest
|
||||
@ -561,8 +560,7 @@ begin
|
||||
Dest:=PChar(Result);
|
||||
SourceEnd := Source + SourceLen;
|
||||
while Source<SourceEnd do begin
|
||||
CharLen := UTF8CharacterLength(Source);
|
||||
if (CharLen=1) and (Source^='\') then begin
|
||||
if (Source^='\') then begin
|
||||
CopyPart;
|
||||
inc(Source);
|
||||
if Source^ in ['t', 'n', '"', '\'] then begin
|
||||
@ -589,7 +587,7 @@ begin
|
||||
SourceCopied := Source;
|
||||
end
|
||||
else
|
||||
Inc(Source, CharLen);
|
||||
Inc(Source, UTF8CharacterLength(Source));
|
||||
end;
|
||||
CopyPart;
|
||||
SetLength(Result, Dest - PChar(Result));
|
||||
|
Loading…
Reference in New Issue
Block a user