fpc/tests/test/tcpstr6.pp
paul 8b0cb2c1d5 compiler:
- don't parse '(' token after the type declaration inside the type block
  - replace parse of "string<codepage>" to "type AnsiString(codepage)" for delphi compatibility
  - fix tests to use "type AnsiString(codepage)"

git-svn-id: trunk@19148 -
2011-09-19 04:11:57 +00:00

27 lines
456 B
ObjectPascal

{$CODEPAGE cp1251}
// file encoding is cp1251
type
Cp866String = type AnsiString(866);
Cp1251String = type AnsiString(1251);
procedure WriteString(const s: RawByteString);
begin
Write(StringCodePage(s), ' : ');
WriteLn(s);
end;
var
u : UnicodeString;
c1251: Cp1251String;
c866: Cp866String;
begin
c1251 := 'Ïðèâåò';
WriteString(c1251);
u := c1251;
WriteString(u);
c866 := c1251;
c866 := c866 + c1251;
WriteString(c866);
end.