tw18075.pp 647 B

12345678910111213141516171819202122232425262728293031323334353637
  1. {$codepage UTf8}
  2. Var cad1:unicodeString;
  3. cad2:Widestring;
  4. n:integer;
  5. Begin
  6. cad1:='犮犯狃狄狪独';
  7. cad2:=cad1;
  8. //Unicodestring, 1 character is ok
  9. Writeln('unicodestring');
  10. n:=pos('犮',cad1);
  11. Writeln(n);
  12. if n<>1 then
  13. halt(1);
  14. Writeln('widestring');
  15. n:=pos('犮',cad2);
  16. Writeln(n);
  17. if n<>1 then
  18. halt(1);
  19. //Unicodestring, more charactere wrong
  20. Writeln('unicodestring');
  21. n:=pos('狃狄',cad1);
  22. Writeln(n); //show position 0
  23. if n<>3 then
  24. halt(1);
  25. Writeln('widestring');
  26. n:=pos('狃狄',cad2); //Is correct position 3
  27. Writeln(n);
  28. if n<>3 then
  29. halt(1);
  30. Writeln('ok');
  31. End.