[fpc-devel] How to set code page in terminal? (Windows)

Sven Barth pascaldragon at googlemail.com
Tue Aug 14 10:10:27 CEST 2012


Am 14.08.2012 09:08, schrieb Marco van de Voort:
> In our previous episode, silvioprog said:
>> ------------------------------------------------------------
>> program test;
>>
>> {$mode objfpc}{$H+}
>>
>> {$IFDEF MSWINDOWS}
>> uses
>>    windows;
>> {$ENDIF}
>>
>> const
>>    C = 'Aten??o';
>> begin
>> {$IFDEF MSWINDOWS}
>>    SetConsoleOutputCP(CP_UTF8);
>>    SetTextCodePage(Output, CP_UTF8);
>> {$ENDIF}
>>    WriteLn(C);
>> end.
>> ------------------------------------------------------------
>
> Windows has two sets of console routines. One set that is universal over
> win9x and WinNT, one that is WinNT only.
>
> FPC uses the universal ones (still), the above code is WinNT only.

Another reason to deprecate 9x? ;)

Regards,
Sven




More information about the fpc-devel mailing list