mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-10 17:37:41 +01:00
* fixed string code page after setstring(rawbytestring,..) (mantis #29833)
git-svn-id: trunk@33268 -
This commit is contained in:
parent
632de58a5e
commit
5919ca84bb
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12921,6 +12921,7 @@ tests/test/tutf8cpl.pp svneol=native#text/plain
|
||||
tests/test/tvarpropsetter1.pp svneol=native#text/plain
|
||||
tests/test/tvarpropsetter2.pp svneol=native#text/plain
|
||||
tests/test/tvarset1.pp svneol=native#text/plain
|
||||
tests/test/tw29833.pp svneol=native#text/plain
|
||||
tests/test/twarn1.pp svneol=native#text/pascal
|
||||
tests/test/tweaklib1.pp svneol=native#text/plain
|
||||
tests/test/tweaklib2.pp svneol=native#text/plain
|
||||
|
||||
@ -515,6 +515,7 @@ implementation
|
||||
var
|
||||
paras, strpara, pcharpara: tnode;
|
||||
procname: string;
|
||||
cp: tstringencoding;
|
||||
begin
|
||||
consume(_LKLAMMER);
|
||||
paras:=parse_paras(false,false,_RKLAMMER);
|
||||
@ -534,7 +535,12 @@ implementation
|
||||
( = paras.right.right) is an ansistring, add a codepage
|
||||
parameter }
|
||||
if is_ansistring(strpara.resultdef) then
|
||||
paras:=ccallparanode.create(genintconstnode(tstringdef(strpara.resultdef).encoding),paras);
|
||||
begin
|
||||
cp:=tstringdef(strpara.resultdef).encoding;
|
||||
if (cp=globals.CP_NONE) then
|
||||
cp:=0;
|
||||
paras:=ccallparanode.create(genintconstnode(cp),paras);
|
||||
end;
|
||||
procname:='fpc_setstring_'+tstringdef(strpara.resultdef).stringtypname;
|
||||
{ decide which version to call based on the second parameter }
|
||||
if not is_shortstring(strpara.resultdef) then
|
||||
|
||||
9
tests/test/tw29833.pp
Normal file
9
tests/test/tw29833.pp
Normal file
@ -0,0 +1,9 @@
|
||||
var
|
||||
aURI,Server:rawbytestring;
|
||||
|
||||
begin
|
||||
aURI:='abcdefg';
|
||||
SetString(Server,@aURI[1],Length(aURI));
|
||||
if stringcodepage(server)=CP_NONE then
|
||||
halt(1);
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user