|
@@ -13122,6 +13122,7 @@ begin
|
|
begin
|
|
begin
|
|
if (bt=btAnsiChar) or ((bt=btChar) and (BaseTypeChar=btWideChar)) then
|
|
if (bt=btAnsiChar) or ((bt=btChar) and (BaseTypeChar=btWideChar)) then
|
|
begin
|
|
begin
|
|
|
|
+ // ansichar(ansistring)
|
|
if fExprEvaluator.StringToOrd(Value,nil)>$ffff then
|
|
if fExprEvaluator.StringToOrd(Value,nil)>$ffff then
|
|
RaiseXExpectedButYFound(20181005141025,'char','string',Params);
|
|
RaiseXExpectedButYFound(20181005141025,'char','string',Params);
|
|
Result:=Value;
|
|
Result:=Value;
|
|
@@ -13129,6 +13130,7 @@ begin
|
|
end
|
|
end
|
|
else if (bt=btWideChar) or ((bt=btChar) and (BaseTypeChar=btWideChar)) then
|
|
else if (bt=btWideChar) or ((bt=btChar) and (BaseTypeChar=btWideChar)) then
|
|
begin
|
|
begin
|
|
|
|
+ // widechar(ansistring)
|
|
if fExprEvaluator.GetWideChar(TResEvalString(Value).S,w) then
|
|
if fExprEvaluator.GetWideChar(TResEvalString(Value).S,w) then
|
|
begin
|
|
begin
|
|
Result:=Value;
|
|
Result:=Value;
|
|
@@ -13136,6 +13138,24 @@ begin
|
|
end
|
|
end
|
|
else
|
|
else
|
|
RaiseXExpectedButYFound(20181005141058,'char','string',Params);
|
|
RaiseXExpectedButYFound(20181005141058,'char','string',Params);
|
|
|
|
+ end
|
|
|
|
+ else if (bt=btAnsiString) or ((bt=btString) and (BaseTypeString=btAnsiString)) then
|
|
|
|
+ begin
|
|
|
|
+ // ansistring(ansistring)
|
|
|
|
+ Result:=Value;
|
|
|
|
+ Value:=nil;
|
|
|
|
+ end
|
|
|
|
+ else if (bt=btUnicodeString) or (bt=btWideString)
|
|
|
|
+ or ((bt=btString) and (BaseTypeString=btUnicodeString)) then
|
|
|
|
+ begin
|
|
|
|
+ // unicodestring(ansistring)
|
|
|
|
+ Result:=TResEvalUTF16.CreateValue(
|
|
|
|
+ fExprEvaluator.GetUnicodeStr(TResEvalString(Value).S,Params));
|
|
|
|
+ end
|
|
|
|
+ else if bt=btRawByteString then
|
|
|
|
+ begin
|
|
|
|
+ // rawbytestring(ansistring)
|
|
|
|
+ SetCodePage(TResEvalString(Value).S,CP_NONE,false);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
{$endif}
|
|
{$endif}
|
|
@@ -13146,6 +13166,7 @@ begin
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
{$ifdef FPC_HAS_CPSTRING}
|
|
if (bt=btAnsiChar) or ((bt=btChar) and (BaseTypeChar=btAnsiChar)) then
|
|
if (bt=btAnsiChar) or ((bt=btChar) and (BaseTypeChar=btAnsiChar)) then
|
|
begin
|
|
begin
|
|
|
|
+ // ansichar(unicodestring)
|
|
if ord(w)<=255 then
|
|
if ord(w)<=255 then
|
|
begin
|
|
begin
|
|
Result:=Value;
|
|
Result:=Value;
|
|
@@ -13158,9 +13179,28 @@ begin
|
|
{$endif}
|
|
{$endif}
|
|
if (bt=btWideChar) or ((bt=btChar) and (BaseTypeChar=btWideChar)) then
|
|
if (bt=btWideChar) or ((bt=btChar) and (BaseTypeChar=btWideChar)) then
|
|
begin
|
|
begin
|
|
|
|
+ // widechar(unicodestring)
|
|
Result:=Value;
|
|
Result:=Value;
|
|
Value:=nil;
|
|
Value:=nil;
|
|
end;
|
|
end;
|
|
|
|
+ end
|
|
|
|
+ else if (bt=btAnsiString) or ((bt=btString) and (BaseTypeString=btAnsiString)) then
|
|
|
|
+ begin
|
|
|
|
+ // ansistring(unicodestring)
|
|
|
|
+ Result:=TResEvalString.CreateValue(
|
|
|
|
+ fExprEvaluator.GetRawByteString(TResEvalUTF16(Value).S,CP_ACP,Params));
|
|
|
|
+ end
|
|
|
|
+ else if (bt=btUnicodeString) or ((bt=btString) and (BaseTypeString=btUnicodeString)) then
|
|
|
|
+ begin
|
|
|
|
+ // unicodestring(unicodestring)
|
|
|
|
+ Result:=Value;
|
|
|
|
+ Value:=nil;
|
|
|
|
+ end
|
|
|
|
+ else if bt=btRawByteString then
|
|
|
|
+ begin
|
|
|
|
+ // rawbytestring(unicodestring)
|
|
|
|
+ Result:=TResEvalString.CreateValue(
|
|
|
|
+ fExprEvaluator.GetRawByteString(TResEvalUTF16(Value).S,CP_NONE,Params));
|
|
end;
|
|
end;
|
|
revkExternal:
|
|
revkExternal:
|
|
exit;
|
|
exit;
|