$ filename "t.exe"
'uses RTL32
'uses RTL64

uses console


% LF_FACESIZE=32
% FF_DONTCARE=0
% FW_NORMAL=400
% TMPF_TRUETYPE=4

type CONSOLE_FONT_INFOEX
  ulong cbSize
  dword nFont
  COORD dwFontSize
  uint  FontFamily
  uint  FontWeight
  wchar FaceName[LF_FACESIZE]
end type

extern lib "kernel32.dll"
! SetConsoleTitleW             '1
! ReadConsoleW                 '5
! WriteConsoleW                '5
! SetConsoleCP                 '1 -Codepage for Input
! GetConsoleCP                 '0
! SetConsoleOutputCP           '1
! GetConsoleOutputCP           '0
! SetCurrentConsoleFontEx      '3 -Vista and later
! GetCurrentConsoleFontEx      '3 -Vista and later
'! GetConsoleModeW
'! SetConsoleModeW
end extern

  Function woutput(wstring bufout)
  ===============================
  static long buflen,bufrit
  buflen=len(bufout)
  WriteConsoleW ConsOut,strptr bufout,buflen,bufrit,null
  End Function

  function winput() as wstring
  ===========================
  wstring bufin=nuls 1000
  dword blen
  ReadConsoleW ConsIn,strptr bufin,100, @blen,0
  function=left bufin,blen
  end function

  'UNICODE OVERRIDE
  function GetKey() as int
  ========================
  word bufin[4]
  dword blen, mode
  GetConsoleMode ConsIn,mode
  SetConsoleMode ConsIn,0
  ReadConsoleW ConsIn,@bufin,1, @blen,0
  SetConsoleMode ConsIn,mode
  function=bufin
  end function

  wstring wcrlf=wchr(13)+wchr(10)
  wstring wtab=wchr(9)

  'wprint override
  def wprint   woutput

=========================================================


'russian
wstring title="OxygenBasic Unicode Test: "+
      wchr(1088)+wchr(1091)+wchr(1089)+wchr(1089)+wchr(1082)+wchr(1080)+wchr(1081)

'Ansi
SetConsoleTitle title

printl "Ansi:"
int cp=GetConsoleOutputCP
printl "Codepage = " cp
printl "Title: " title
print cr cr
print "What is your name? "
wstring name = input()
print  "Ansi:    " name
wprint "Unicode: " name

print cr
printl "Enter ..."
wait
'print "What is your name? "
'wstring name = input()

'Unicode
SetConsoleTitleW title

wstring fontname
fontname="Lucida Console"
CONSOLE_FONT_INFOEX cfi
cfi.cbsize=sizeof(CONSOLE_FONT_INFOEX)
cfi.FontFamily=TMPF_TRUETYPE
cfi.FaceName=fontname

SetCurrentConsoleFontEx ConsOut,true , cfi
GetCurrentConsoleFontEx ConsOut, true, cfi

print cr
printl "Changed Font to " cfi.FaceName

print cr
printl  "Ansi:    " title
print cr
wprint  "Unicode: " title
print cr

printl "your name? "
name = input()
 
printl "Your name (Ansi)    = " name
wprint "Your name (Unicode) = " name
print cr

printl "Russion Alphabet"
wstring codes
int x
for x=1040 to 1103
  codes &= wchr(x) & ","
next
wprint codes

print cr
printl "Enter ..." : wait

cls
fontname="Terminal"
CONSOLE_FONT_INFOEX cfi2
cfi2.cbsize=sizeof(CONSOLE_FONT_INFOEX)
cfi2.FaceName= fontname

SetCurrentConsoleFontEx ConsOut, true, cfi2
GetCurrentConsoleFontEx ConsOut, true, cfi2

printl "Back to " cfi2.FaceName
print cr
printl "Russian alphabet (Ansi)"
printl codes
printl "Russian alphabet (Unicode)"
print cr
wprint codes

print cr
printl "Enter ..." : wait