fpc/tests/webtbs/tw4254.pp
Jonas Maebe d73e79f163 * fixed regression of webtbs/tw4254: if a constant (wide)string can't be
converted to a pchar at compile time, remove the cstring_to_pchar node
    because it expects a stringconstn in pass_generate_code

git-svn-id: trunk@8275 -
2007-08-13 09:13:07 +00:00

19 lines
434 B
ObjectPascal

{$codepage utf8}
{ Source provided for Free Pascal Bug Report 4254 }
{ Submitted by "rimga" on 2005-08-04 }
{ e-mail: rimga@ktl.mii.lt }
//when source encoded in utf8
var
p: pchar;
begin
p:= 'abc'#261;
//constant is internally treated as of wide chars a0b0c0#105 (it is ok)
//but assigning it to pchar it has to be converted to 8-bit chars
if strlen(p)= 1 then
begin
writeln('problem');
halt(1);
end;
end.