# DBCS with an SA-based field and a DBCS (SFE) field.

rows 43
columns 80
codepage cp930

# Ask for TN3270E.
telnet.do tn3270e
flush

# Ask for the device type.
telnet.sb tn3270e
 raw 0802 # send device-type
 telnet.se
flush

# Tell them what the device type is.
telnet.sb tn3270e
 raw 0204 # device-type is
 atext IBM-3278-4-E
 raw 01 # connect
 atext TEST
 telnet.se
flush

# Tell them what TN3270E we will support (no BIND-IMAGE)
telnet.sb tn3270e
 raw 0304 # functions is
 raw 0204 #  RESPONSES SYSREQ
 telnet.se
flush

# Set reply mode to character.
#tn3270e 3270-data none error-response 1
#    wsf len=6 set-reply-mode partition 00 character-mode charset
 # raw 11000609000243
 # telnet.eor
flush
# Draw the screen.
tn3270e 3270-data none error-response 2
 cmd.ewa restore
  ord.sba 1 1
  ord.sfe 3270 protect fg default
  text "DBCS characters"
  # Define an ordinary field with DBCS extended attributes, interrupted by a stretch of non-DBCS.
  ord.sba 2 1
  ord.sf protect,high,modify
  text "DBCS SA "
  ord.sf high,modify
  ord.sa charset dbcs
  text 国内外の
  ord.sa charset default
  text abc
  ord.sa charset dbcs
  text 国内外の
  ord.sa charset default
  ord.sf protect
  ord.sba 3 1
  ord.sf protect,high,modify
  text "DBCS SFE"
  # Define an extended field with the APL charset, with redundant APL extended attributes in the middle.
  # The APL EA region should be reported with GEs by the RM below.
  ord.sfe 3270 high,modify charset dbcs
  text 国内外の国内外の
  ord.sf protect
  # Now an additional modified field to make sure the SA reported for the line above is terminated.
  ord.sba 4 1
  ord.sf protect,high,modify
  text "Another field"
  # Then the usual input field.
  ord.sba 14 1
  ord.sf modify
  ord.ic
  ord.sba 15 1
  ord.sf protect
 telnet.eor
# Read it back.
tn3270e 3270-data none error-response 2
 cmd.rm
 telnet.eor
flush
