tcpstr9.pp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. { %skiptarget=android }
  2. {$ifdef go32v2}
  3. {$define USE_INTERNAL_UNICODE}
  4. {$endif}
  5. {$ifdef USE_INTERNAL_UNICODE}
  6. {$define USE_FPWIDESTRING_UNIT}
  7. {$define USE_UNICODEDUCET_UNIT}
  8. {$define USE_CPALL_UNIT}
  9. {$endif}
  10. program tcpstr9;
  11. {$mode delphiunicode}
  12. {$apptype console}
  13. {$ifndef USE_INTERNAL_UNICODE}
  14. {$ifdef unix}
  15. uses
  16. {$ifdef darwin}iosxwstr{$else}cwstring{$endif};
  17. {$endif unix}
  18. {$else def USE_INTERNAL_UNICODE}
  19. uses
  20. {$ifdef USE_FPWIDESTRING_UNIT}
  21. fpwidestring,
  22. {$endif}
  23. {$ifdef USE_UNICODEDUCET_UNIT}
  24. unicodeducet,
  25. {$endif}
  26. {$ifdef USE_CPALL_UNIT}
  27. cpall,
  28. {$endif}
  29. { The unit strings is not really used here,
  30. but simpifies the conditional construction
  31. for fpwidestring and unicodeducet use }
  32. strings;
  33. {$endif def USE_INTERNAL_UNICODE}
  34. begin
  35. // this test can be only run with the compiler built right now on the
  36. // same system
  37. if StringCodePage(AnsiString('test')) <> DefaultSystemCodePage then
  38. begin
  39. WriteLn(StringCodePage(AnsiString('test')), ' <> ', DefaultSystemCodePage);
  40. halt(1);
  41. end;
  42. Writeln('ok');
  43. end.