Display of Chinese Characters on AS/400 Using Client Access.

pts.
Tags:
AS/400
Development
Hi, I am trying to change and display the chinese characters on AS/400 Screen. I am using Client Access Express Version 5.I have copied the chinese characters from the web and tried to paste it on the AS/400 screen but its diaplying as ????? instead of chinese characters.I have changed my system(PC) to allow Traditional & Simpliefied chinese characters in the regional settings. I have made the changes to the display file (DATA TYPE as : "O")on AS/400 in order to allow the DBCS Charecters while editing and displaying. But still I am not able to paste and display the chinese characters. One thing noticed on AS/400 client Access configuration, it is not allowing me to change the Host code page as Traditional or Simplified Chinese. Could some one help me in pasting the Chinese characters on the AS/400 screen and display them correctly. Thanks in advance. Regards HAMSA

Answer Wiki

Thanks. We'll let you know when a new response is added.

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”.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following