How can I print Greek characters with the print command and get Greek characters in the MS-DOS screen ?
PRINT*,"C oei? oi? I ??iae ="
I don't think it's possible unless you set your system locale to Greek (Control Panel/Regional/Locale and Set default).
If the characters you want aren't in the default console codepage, you can use the Win32 API routine SetConsoleCodepage to change the codepage, but only if you're running on NT/2000/XP and if you know the code number for the codepage you want.
Dear Steve,Thank you for your answer. Could you please explain to me by an example this approach.
I have tried to follow your comments but it seems that it does not work. However, thank you for your time.
I am also interested to display greek characters on the console. Here is a program (Fortran console application) which tries to load various output code pages found on the system. It was tested on a Win2000 Pro system, using CVF6.6a. It finds and loads nearly 50 code pages, but the output is displayed using the same code page of 437, which is the default on the system. Any idea, how to change the code page?
hConsoleOut = GetStdHandle( STD_OUTPUT_HANDLE )
iCodePage = 0
Text = 'abcdef'
Do While (iCodePage < 100000)
iCodePage = iCodePage + 1
iRet = SetConsoleOutputCP(iCodePage)
If ( iRet .gt. 0 ) Then
Write (6,10000) iCodePage
lret = WriteConsole( hConsoleOut, loc(Text),5, loc(lpNumberOfCharsWritten),Loc(lpReserved))
10000 Format(' iCodePage=',i6)