mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 18:10:29 +02:00

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 -
29 lines
464 B
ObjectPascal
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.
|