|
@@ -203,10 +203,10 @@ Var
|
|
|
begin
|
|
|
{ if codepages are differ then concat using unicodestring }
|
|
|
S1CP:=StringCodePage(S1);
|
|
|
- if (S1CP=CP_NONE) or (S1CP=0) then
|
|
|
+ if (S1CP=CP_ACP) then
|
|
|
S1CP:=DefaultSystemCodePage;
|
|
|
S2CP:=StringCodePage(S2);
|
|
|
- if (S2CP=CP_NONE) or (S2CP=0) then
|
|
|
+ if (S2CP=CP_ACP) then
|
|
|
S2CP:=DefaultSystemCodePage;
|
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
|
if (Pointer(DestS)=nil) then
|
|
@@ -216,7 +216,7 @@ begin
|
|
|
{$else FPC_HAS_CPSTRING}
|
|
|
DestCP:=StringCodePage(DestS);
|
|
|
{$endif FPC_HAS_CPSTRING}
|
|
|
- if (DestCP=CP_NONE) or (DestCP=0) then
|
|
|
+ if (DestCP=CP_ACP) then
|
|
|
DestCP:=DefaultSystemCodePage;
|
|
|
if (S1CP<>DestCP) or (S2CP<>DestCP) then
|
|
|
begin
|
|
@@ -291,7 +291,7 @@ begin
|
|
|
{$else FPC_HAS_CPSTRING}
|
|
|
DestCP:=StringCodePage(DestS);
|
|
|
{$endif FPC_HAS_CPSTRING}
|
|
|
- if (DestCP=CP_NONE) or (DestCP=0) then
|
|
|
+ if (DestCP=CP_ACP) then
|
|
|
DestCP:=DefaultSystemCodePage;
|
|
|
sameCP:=true;
|
|
|
lowstart:=low(sarr);
|
|
@@ -308,7 +308,7 @@ begin
|
|
|
U:='';
|
|
|
for i:=lowstart to high(sarr) do begin
|
|
|
tmpCP:=StringCodePage(sarr[i]);
|
|
|
- if (tmpCP=CP_NONE) or (tmpCP=0) then
|
|
|
+ if (tmpCP=CP_ACP) then
|
|
|
begin
|
|
|
tmpStr:=sarr[i];
|
|
|
SetCodePage(tmpStr,DefaultSystemCodePage,False);
|
|
@@ -408,7 +408,7 @@ begin
|
|
|
Size:=Length(S);
|
|
|
if Size>0 then
|
|
|
begin
|
|
|
- if (cp=0) or (cp=CP_NONE) then
|
|
|
+ if (cp=CP_ACP) then
|
|
|
cp:=DefaultSystemCodePage;
|
|
|
orgcp:=StringCodePage(S);
|
|
|
if (orgcp=cp) or (orgcp=CP_NONE) then
|
|
@@ -489,7 +489,7 @@ Var
|
|
|
{$endif FPC_HAS_CPSTRING}
|
|
|
begin
|
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
|
- if (cp=0) or (cp=CP_NONE) then
|
|
|
+ if (cp=CP_ACP) then
|
|
|
cp:=DefaultSystemCodePage;
|
|
|
{$else FPC_HAS_CPSTRING}
|
|
|
cp:=DefaultSystemCodePage;
|
|
@@ -513,7 +513,7 @@ var
|
|
|
{$endif FPC_HAS_CPSTRING}
|
|
|
begin
|
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
|
- if (cp=0) or (cp=CP_NONE) then
|
|
|
+ if (cp=CP_ACP) then
|
|
|
cp:=DefaultSystemCodePage;
|
|
|
{$else FPC_HAS_CPSTRING}
|
|
|
cp:=DefaultSystemCodePage;
|
|
@@ -541,7 +541,7 @@ begin
|
|
|
if L > 0 then
|
|
|
begin
|
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
|
- if (cp=0) or (cp=CP_NONE) then
|
|
|
+ if (cp=CP_ACP) then
|
|
|
cp:=DefaultSystemCodePage;
|
|
|
{$else FPC_HAS_CPSTRING}
|
|
|
cp:=DefaultSystemCodePage;
|
|
@@ -576,7 +576,7 @@ begin
|
|
|
if i > 0 then
|
|
|
begin
|
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
|
- if (cp=0) or (cp=CP_NONE) then
|
|
|
+ if (cp=CP_ACP) then
|
|
|
cp:=DefaultSystemCodePage;
|
|
|
{$else FPC_HAS_CPSTRING}
|
|
|
cp:=DefaultSystemCodePage;
|
|
@@ -674,10 +674,10 @@ begin
|
|
|
else
|
|
|
begin
|
|
|
r1:=S1;
|
|
|
- if (cp1=CP_NONE) or (cp1=0) then
|
|
|
+ if (cp1=CP_ACP) then
|
|
|
SetCodePage(r1,DefaultSystemCodePage,false);
|
|
|
r2:=S2;
|
|
|
- if (cp2=CP_NONE) or (cp2=0) then
|
|
|
+ if (cp2=CP_ACP) then
|
|
|
SetCodePage(r2,DefaultSystemCodePage,false);
|
|
|
//convert them to utf8 then compare
|
|
|
SetCodePage(r1,65001);
|
|
@@ -728,10 +728,10 @@ begin
|
|
|
else
|
|
|
begin
|
|
|
r1:=S1;
|
|
|
- if (cp1=CP_NONE) or (cp1=0) then
|
|
|
+ if (cp1=CP_ACP) then
|
|
|
SetCodePage(r1,DefaultSystemCodePage,false);
|
|
|
r2:=S2;
|
|
|
- if (cp2=CP_NONE) or (cp2=0) then
|
|
|
+ if (cp2=CP_ACP) then
|
|
|
SetCodePage(r2,DefaultSystemCodePage,false);
|
|
|
//convert them to utf8 then compare
|
|
|
SetCodePage(r1,65001);
|
|
@@ -784,7 +784,7 @@ begin
|
|
|
GetMem(Pointer(S),AnsiRecLen+L);
|
|
|
PAnsiRec(S)^.Ref:=1;
|
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
|
- if (cp=0) or (cp=CP_NONE) then
|
|
|
+ if (cp=CP_ACP) then
|
|
|
cp:=DefaultSystemCodePage;
|
|
|
PAnsiRec(S)^.CodePage:=cp;
|
|
|
{$else}
|
|
@@ -1249,7 +1249,7 @@ begin
|
|
|
Dec(Index);
|
|
|
SetLength(Temp,Length(Source)+LS);
|
|
|
cp:=StringCodePage(S);
|
|
|
- if (cp=0) or (cp=CP_NONE) then
|
|
|
+ if (cp=CP_ACP) then
|
|
|
cp:=DefaultSystemCodePage;
|
|
|
SetCodePage(Temp,cp,false);
|
|
|
If Index>0 then
|