mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 08:29:27 +02:00
rtl: don't perform string conversion if source string is in CP_NONE encoding (rawbytestring)
git-svn-id: trunk@19420 -
This commit is contained in:
parent
7013237317
commit
1c41680c58
@ -402,6 +402,7 @@ Function fpc_AnsiStr_To_AnsiStr (const S : RawByteString;cp : TSystemCodePage):
|
|||||||
Var
|
Var
|
||||||
Size : SizeInt;
|
Size : SizeInt;
|
||||||
temp : UnicodeString;
|
temp : UnicodeString;
|
||||||
|
orgcp: TSystemCodePage;
|
||||||
begin
|
begin
|
||||||
result:='';
|
result:='';
|
||||||
Size:=Length(S);
|
Size:=Length(S);
|
||||||
@ -409,7 +410,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
if (cp=0) or (cp=CP_NONE) then
|
if (cp=0) or (cp=CP_NONE) then
|
||||||
cp:=DefaultSystemCodePage;
|
cp:=DefaultSystemCodePage;
|
||||||
if (StringCodePage(S)=cp) then
|
orgcp:=StringCodePage(S);
|
||||||
|
if (orgcp=cp) or (orgcp=CP_NONE) then
|
||||||
begin
|
begin
|
||||||
SetLength(result,Size);
|
SetLength(result,Size);
|
||||||
Move(S[1],result[1],Size);
|
Move(S[1],result[1],Size);
|
||||||
|
Loading…
Reference in New Issue
Block a user