fpc/tests/test/tcpstr24.pp
Jonas Maebe fb8fb29574 * record/use the code page of string constants typecasted to an ansistring
type with a non-default code page
   TODO: ensure that string constants typecasted to ansistring become
     ansistrings rather than typeless string constants

git-svn-id: trunk@25207 -
2013-08-02 13:23:32 +00:00

29 lines
464 B
ObjectPascal

{$codepage utf8}
type
str866 = type ansistring(866);
const
x = utf8string('abcdef');
y = utf8string('®†◊√');
z = str866('abc');
procedure test(const x: shortstring);
begin
writeln('shortstring!');
halt(1);
end;
procedure test(const x: rawbytestring; cp: tsystemcodepage);
begin
writeln('ansistring(',stringcodepage(x),')');
if stringcodepage(x)<>cp then
halt(2);
end;
begin
test(x,CP_UTF8);
test(y,CP_UTF8);
test(z,866);
end.