mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-06 02:27:48 +02:00
fcl-passrc: fixed resolve string lit on non utf-8 system
This commit is contained in:
parent
dc85b9283f
commit
917aba3de2
@ -4203,6 +4203,7 @@ var
|
||||
{$ENDIF}
|
||||
begin
|
||||
if h='' then exit;
|
||||
//writeln('AddSrc ',length(h),' ',ord(h[1]),' ',stringcodepage(h),' ',defaultsystemcodepage);
|
||||
{$ifdef FPC_HAS_CPSTRING}
|
||||
OnlyASCII:=true;
|
||||
for i:=1 to length(h) do
|
||||
@ -4238,9 +4239,14 @@ var
|
||||
RaiseNotYetImplemented(20201220222608,Expr);
|
||||
else
|
||||
begin
|
||||
if Value.OnlyASCII and (Value.S<>'') then
|
||||
SetCodePage(Value.S,TargetCP,false);
|
||||
Value.S:=Value.S+h;
|
||||
if Value.S<>'' then
|
||||
begin
|
||||
if Value.OnlyASCII then
|
||||
SetCodePage(Value.S,TargetCP,false);
|
||||
Value.S:=Value.S+h;
|
||||
end else begin
|
||||
Value.S:=h;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -2180,6 +2180,7 @@ begin
|
||||
Result.OnFindUnit:=@OnPasResolverFindUnit;
|
||||
Result.OnLog:=@OnPasResolverLog;
|
||||
Result.Hub:=Hub;
|
||||
Result.ExprEvaluator.DefaultStringCodePage:=CP_UTF8;
|
||||
Result.ExprEvaluator.DefaultSourceCodePage:=CP_UTF8;
|
||||
FModules.Add(Result);
|
||||
end;
|
||||
@ -14306,7 +14307,6 @@ end;
|
||||
|
||||
procedure TTestResolver.TestStaticArrayOfChar;
|
||||
begin
|
||||
ResolverEngine.ExprEvaluator.DefaultStringCodePage:=CP_UTF8;
|
||||
StartProgram(false);
|
||||
Add([
|
||||
'type',
|
||||
@ -14328,7 +14328,6 @@ end;
|
||||
|
||||
procedure TTestResolver.TestStaticArrayOfCharDelphi;
|
||||
begin
|
||||
ResolverEngine.ExprEvaluator.DefaultStringCodePage:=CP_UTF8;
|
||||
StartProgram(false);
|
||||
Add([
|
||||
'{$mode delphi}',
|
||||
|
Loading…
Reference in New Issue
Block a user