Hello experts,
I would like to write a program in RPG to print out Vietnamese characters with accents, for example ắ, ấ, ỏ, ọ, ... But I don't know the way AS/400 can support. In SBCS, just some of characters are support. I really appreciate if you guys advice me a solution.
Thanks.
Tuan Anh
Software/Hardware used:
ASKED:
July 9, 2009 5:08 PM
UPDATED:
August 3, 2009 9:43 AM
Hello Teandy
Thanks for your response.
I did as you advice, and I have a snippet code following:
and the program was compiled successfully. I looked into the spooled file generated by compilation, I noticed that the CCSID of variable Text is 13488. And while debugging, I evaluate the value of Text, and its value is êÒ, but the correct value should be ể in CCSID 1130.
Then i try to add the keyword ccsid(1130) in the declaration of TEXT variable,
and re-compile the program. But the compilation occurs error with the severity code 20: CCSID(1130) is not allowed in TEXT
Could you please help me correct it?
Thank you.
Tuan,
CCSID is a system value, not an attribute. CCSID 13488 is Unicode 2.0, UTF-16 BE with IBM PUA.
To change this system value, use the WRKSYSVAL command. Example: WRKSYSVAL QCCSID.
As I said, this will affect all users and objects on the box, so make sure that this is what you want to do.
You can get a list of CCSID’s here: http://www-01.ibm.com/software/globalization/ccsid/ccsid_registered.jsp
I also noticed in the V5R4 RPGLE manual that the BIF %UCS2 has an optional second parameter for the CCSID. You might want to look into using that before you start thinking about changing the CCSID for the entire box.
Using your code, change
Also from the manual:
<quote>
If the parameter is a constant, the conversion will be done at compile time.
If the conversion results in substitution characters, a warning message is issued at compile time. At run time, status 00050 is set and no error message is issued.
</quote>
Hello Teandy,
Thanks again for your support.
Now I success to write Vietnamese characters for my RPGLE program. But I just see them correctly when I debug using Websphere Development Client Studio (WDSC), but if I do with the build-in debugger of AS/400 (using Personal Communication in ‘green screen’), they are incorrect. I think I should create my own *WSCST object to support displaying Vietnamese characters in Personal Communications and for printing out, do you think that is a solution?
Thanks expert,
Tuan Anh
Hello Vining,
Could you give me some clues for how to configure Vietnamese for workstation and for printing?
I have taked some following steps:
– Create a Workstation Customization named WINFO1552 to build a translation for EBCDIC 1130 to ASCII 1258 for Vietnamese in Windows XP.
– Set up the Host Print Transform for printer named QPADEV0001 using the customized-WSCST object. I used the following command to change configuration of printer:
CHGDEVPRT DEVD(QPADEV0001) LNGTYPE(USI) TRANSFORM(*YES) MFRTYPMDL(*INFOPRINT1500) CHRID(1136 1130) WSCST(*LIBL/WINFO1552)
Then I try printing the spooled file with Vietnamese characters using this printer. But the output data is incorrect.
I tested customization object WINFO1552 by writing a small program in Java to read this spooled file and output data to text file. I also changed in Control Panel/Regional and Language Options for Windows XP to ASCII code 1258. Then I use Notepad.exe to view data, the data is correct. I’m really in impasse.
I appreciate for any help from you.