* set the code page of rawbytestring typed constants to the same value as

when assigning a string constant to a rawbytestring (system code page with
    {$modeswitch systemcodepage}, CP_ACP without) (mantis #25332)

git-svn-id: trunk@26397 -
This commit is contained in:
Jonas Maebe 2014-01-05 18:26:10 +00:00
parent 729ac297e4
commit ffd6a4ea47
4 changed files with 25 additions and 0 deletions

2
.gitattributes vendored
View File

@ -13757,6 +13757,8 @@ tests/webtbs/tw2525.pp svneol=native#text/plain
tests/webtbs/tw25269.pp svneol=native#text/pascal
tests/webtbs/tw25289.pp svneol=native#text/plain
tests/webtbs/tw25318.pp svneol=native#text/pascal
tests/webtbs/tw25332.pp svneol=native#text/plain
tests/webtbs/tw25332a.pp svneol=native#text/plain
tests/webtbs/tw25349.pp svneol=native#text/plain
tests/webtbs/tw2536.pp svneol=native#text/plain
tests/webtbs/tw25361.pp svneol=native#text/plain

View File

@ -455,6 +455,12 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
begin
strlength:=tstringconstnode(node).len;
strval:=tstringconstnode(node).value_str;
{ the def may have changed from e.g. RawByteString to
AnsiString(CP_ACP) }
if node.resultdef.typ=stringdef then
def:=tstringdef(node.resultdef)
else
internalerror(2014010501);
end
else
begin

9
tests/webtbs/tw25332.pp Normal file
View File

@ -0,0 +1,9 @@
{mode delphiunicode}
const r: rawbytestring = 'abc';
begin
if (stringcodepage(r) <> CP_ACP) and
(stringcodepage(r) <> DefaultSystemCodePage) then
halt(1);
end.

8
tests/webtbs/tw25332a.pp Normal file
View File

@ -0,0 +1,8 @@
{$mode delphiunicode}
const r: rawbytestring = 'abc';
begin
if stringcodepage(r) = CP_NONE then
halt(1);
end.