mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 00:29:48 +02:00
22 lines
465 B
ObjectPascal
22 lines
465 B
ObjectPascal
program tcpstr16;
|
|
{$mode delphi}
|
|
{$codepage cp1251}
|
|
{$apptype console}
|
|
type
|
|
T866String = type AnsiString(866);
|
|
T1251String = type AnsiString(1251);
|
|
|
|
function Compare(const S1, S2: RawByteString): Boolean;
|
|
begin
|
|
Result :=
|
|
(Length(S1) = Length(S2)) and
|
|
(CompareByte(S1[1],S2[1],Length(S1))=0);
|
|
end;
|
|
|
|
begin
|
|
if Compare(T866String('ïðèâåò'), 'ïðèâåò') then
|
|
halt(1);
|
|
if not Compare(AnsiString(T866String('ïðèâåò')), 'ïðèâåò') then
|
|
halt(2);
|
|
end.
|