I messed around with Korean characters back in 1982. Things may have changed but this was how it worked. IBM represents Chinese, Japanese, Korean, Arabic, etc. characters using the Double Byte Character System (DBCS). That means that, for each single Chinese character, you need to use two-characters of space on the display (two bytes). In order to tell the machine that you are jumping out of the normal 1-byte display mode and into 2-byte display mode, you must start the DBCS data with a “shift-in” field and you end it with a “shift-out” field. You need to look in IBM’s documentation for the correct values but in order for the display to show those type characters, you definitely must start “double-byte” character mode by prefixing the data with the DBCS “shift-in” byte. I think the “shift-in” byte to get you into DBCS is x’0E’. To “shift-out” of DBCS you need to end the field with a x’0F’. (Again, check with the IBM documents about the double-byte character system, (DBCS). It has been so long since I messed with this stuff that I’m not sure that I remember the proper hex values). Each of these shift characters will take one byte out of your field so you need to make the field 2-bytes larger than the maximum size of the data that you need.
To give an example.
Say you want three fields on the screen. The customer name, the first line of the customer address, and the second line of the customer address. You want all of the fields to be Chinese characters. First of all, all of your field lengths would be even number sized. Otherwise you’ll just end up leaving 1 byte all by itself. Lets say that you define the Customer Name field to be 32 bytes long. You would load the first character of the field with the single-byte “shift-in” key. This tells the screen that “from now on” read everything in couplets of two bytes rather than one byte at a time. The screen processor displays the Chinese characters two-bytes at a time (as you have instructed it to). At the very end of the field you put the “shift-out” key. This takes up the last byte of the field and tells the screen processor that “from now on” the remainder of the screen is to be interpreted in single-byte mode. This means that your Customer Name field has a maximum of 15 Chinese characters. Added up: 1-byte “Shift-in” code + (15 Chinese characters x 2 bytes/character) + 1-byte “Shift-out” code = 32 bytes. Now, when you get to the start of the Address Line 1 field, you, once again, insert the Shift-in code to begin showing the address in DBCS Chinese characters and the Shift-out code at the end to revert the processor back to single byte. The logic repeats again for Address Line 2.
Hope this wasn’t totally confusing. I don’t know if things have been made easier in the last twenty some odd years but that was how it worked “way back when”.