
'====================
'UNICODE STRING TESTS
'====================


  % FileName "t.exe"
  'uses rtl64

  '-------------------
  'Wide string casting
  '===================
  '
  'print ((wstring) getfile "greek.txt")
  '
  '----------------
  'Wide string type
  '================
  '
  wstring s,t
  t= (wstring) getfile "greek.txt"
  '
  '-----------------------------------
  'Combine Ascii and unicode correctly
  '===================================
  '
  print "UNICODE:    " t
  '
  '------------------------
  'Wide character wchr demo
  '========================
  '
  print "ALPHA: " wchr(0x3b1)
  '
  '-------------------------
  'Displaying unicode values
  '=========================
  '
  string pr,wr,cr
  sys charco 'character counter
  cr=chr(13)+chr(10)
  '
  'ascii string buffer
  '
  pr="UNICODE VALUES" cr cr
  '
  'iterate through all the unicode characters
  '
  int i
  for i=1 to len t
    '
    'to print fixed length format hexadecimal
    '
    wr=hex unic (t,i),4
    pr+="  "+ mid wr,-4,4
    '
    'whether to add line feed
    '
    charco+=1
    if charco=16 then charco=0 : pr+=cr 'NEW LINE
  next

  print pr 'DISPLAY

  '
  '-----------------
  'Unicode substring
  '=================
  '
  print "SUBSTRING:   " mid t,11,10







