Unicode Console Application in Delphi 2009

后端 未结 6 1330
不知归路
不知归路 2020-12-10 14:19

How can I create unicode console application with Delphi 2009?

If I do like this:

{$APPTYPE CONSOLE}
uses
  SysUtils;
begin
  writeln(\'öüğşç سيمانتت         


        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 14:54

    I'm not sure that is what you're after, but you can create Unicode console applications in all 32-bit Delphi versions by using the Windows API functions. I just tried with Delphi 4:

    program test;
    
    {$APPTYPE CONSOLE}
    
    uses
      Windows;
    
    var
      s: WideString;
      i: integer;
      Written: Cardinal;
    begin
      SetLength(s, 80);
      for i := 1 to 80 do
        s[i] := WideChar(48 + i);
      WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), PWideChar(s), 80, Written,
        nil);
    end.
    

    I don't have Delphi 2009 to try how entering Unicode strings in the editor works...

提交回复
热议问题