diff --git a/lcl/lclproc.pas b/lcl/lclproc.pas index 6bb36de08a..3afdcf82fa 100644 --- a/lcl/lclproc.pas +++ b/lcl/lclproc.pas @@ -2149,12 +2149,13 @@ var SourceEnd: PChar; CharLen: integer; - // Copies from SourceStart to Source to Dest and updates Dest + // Copies from SourceStart till Source to Dest and updates Dest procedure CopyPart; inline; var CopyLength: SizeInt; begin CopyLength := Source - SourceStart; + if CopyLength=0 then exit; move(SourceStart^ , Dest^, CopyLength); inc(Dest, CopyLength); end; diff --git a/lcl/translations.pas b/lcl/translations.pas index 21145d7417..92756e0acb 100644 --- a/lcl/translations.pas +++ b/lcl/translations.pas @@ -304,7 +304,7 @@ begin if CompareMem(LineStart,sCommentIdentifier,3) then begin Identifier:=copy(s,LineStart-p+4,LineLen-3); end else if CompareMem(LineStart,sMsgID,7) then begin - MsgID:=copy(s,LineStart-p+8,LineLen-8); + MsgID:=UTF8CStringToUTF8String(LineStart+7,LineLen-8); end else if CompareMem(LineStart,sMsgStr,8) then begin //MsgStr:=copy(s,LineStart-p+9,LineLen-9); MsgStr:=UTF8CStringToUTF8String(LineStart+8,LineLen-9);