mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-15 07:26:03 +02:00
37 lines
555 B
ObjectPascal
37 lines
555 B
ObjectPascal
uses
|
|
{$ifdef unix}
|
|
cwstring,
|
|
{$endif unix}
|
|
sysutils;
|
|
|
|
type
|
|
ts850 = type AnsiString(850);
|
|
|
|
procedure doerror(ANumber : Integer);
|
|
begin
|
|
WriteLn('error ',ANumber);
|
|
Halt(ANumber);
|
|
end;
|
|
|
|
var
|
|
x : ts850;
|
|
i : Integer;
|
|
ua : array[0..7] of UnicodeChar;
|
|
uc : UnicodeChar;
|
|
us : UnicodeString;
|
|
begin
|
|
x := 'abc'#$00A9#$00AE'123';
|
|
ua := x;
|
|
us := x;
|
|
for i := 1 to Length(us) do
|
|
begin
|
|
uc := us[i];
|
|
if (uc <> ua[i-1]) then begin
|
|
writeln(i);
|
|
doerror(2);
|
|
end;
|
|
end;
|
|
|
|
WriteLn('Ok');
|
|
end.
|