Differences

This shows you the differences between two versions of the page.

Link to this comparison view

5250_and_unicode [2018/03/22 15:40]
5250_and_unicode [2021/04/05 11:23] (current)
Line 1: Line 1:
 +====== 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);
 +
 +<note important>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.</note>
 +==== Output File ====
 +
 +=== Display File ===
 +
 +The field in the display file needs to be defined as ''G'' (graphic) with ''CCSID(13488)''.
 +
 +<note important>CCSID 1200 did not work in my case!</note>
 +
 +<note important>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</note>
 +==== 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
 +
 +<note>Be sure to choose a font which can display the characters. The default font IBM3270 does not seem to have all the characters included.</note>
 +
 +{{tag>ibm}}
 +