mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:09: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
|
||||
Size : SizeInt;
|
||||
temp : UnicodeString;
|
||||
orgcp: TSystemCodePage;
|
||||
begin
|
||||
result:='';
|
||||
Size:=Length(S);
|
||||
@ -409,7 +410,8 @@ begin
|
||||
begin
|
||||
if (cp=0) or (cp=CP_NONE) then
|
||||
cp:=DefaultSystemCodePage;
|
||||
if (StringCodePage(S)=cp) then
|
||||
orgcp:=StringCodePage(S);
|
||||
if (orgcp=cp) or (orgcp=CP_NONE) then
|
||||
begin
|
||||
SetLength(result,Size);
|
||||
Move(S[1],result[1],Size);
|
||||
|
Loading…
Reference in New Issue
Block a user