5250 and Unicode

If you Unicode is used on the system then it must be supported, coded and configured on every level:

  • data (database or streamfile)
  • program (variables)
  • output file (display file or printer file)
  • device (5250 terminal emulator)

Data

Database

Unicode is supported by DDS and SQL. In SQL it needs to be declared as GRAPHIC or VARGRAPHIC with a corresponding CCSID.

Program

At the program level the variables need to be defined with a corresponding 'CCSID' keyword.

  dcl-s buffer char(1048576) ccsid(*utf8);
If the value should be moved to a graphic field in the display file then it value assignment to the display file field may result into a conversion error. A workaround for this is using a ucs2 field in the RPG program and move that value to the display file graphic type field.

Output File

Display File

The field in the display file needs to be defined as G (graphic) with CCSID(13488).

CCSID 1200 did not work in my case!
Graphic fields take double the space of normal character fields because ideographic characters take two character spaces for one character, see https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/nls/rbagsucsdspandpnlgrpcon.htm

Device

The 5250 terminal emulator must support unicode in the data stream. IBM i ACS supports it, see Main Menu → Communication → Configuration → Connection → Unicode Options

Be sure to choose a font which can display the characters. The default font IBM3270 does not seem to have all the characters included.