How to programming with national language in RPG?

35 pts.
Tags:
AS/400 Languages
RPG
RPG Language Support
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

Answer Wiki

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

I don’t think it does support this in SBCS. You May need to look at changing your CCSID to one that supports DBCS. You will also need a printer that supports DBCS.

Here are the CCSID’s that IBM shows for Vietnamese:

<pre>

CCSID (decimal) CCSID (hex) Name

1129 0469 VIETNAMESE ISO8
1130 046A VIETNAMESE EBCDIC
1163 048B VIETNAMESE ISO8
1164 048C VIETNAMESE EBCDIC

</pre>

See http://www-01.ibm.com/software/globalization/ccsid/ccsid_registered.jsp for more information.

——————————————————————

Vietnamese is not DBCS. It’s SBCS just like 37, 500, etc. It does though have a different character set and code page.

Before continuing, do you have a workstation configured for Vietnamese? That will simplify things. If you only have say English workstations then you can still print out Vietnamese, it will just be a bit more work (confusing).

Bruce Vining

Discuss This Question: 4  Replies

 
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
  • nta2804
    Hello Teandy Thanks for your response. I did as you advice, and I have a snippet code following:
    d sOut            c                   x'0E'                           
    d sIn             c                   x'0F'                           
     *                                                                    
    d TEXT            s              4C                                   
     *                                                                    
    c                   eval      text = %ucs2(sOut + x'52' + x'8D' + sIn)
    
    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,
    d text            s              4C   ccsid(1130)
    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.
    35 pointsBadges:
    report
  • Teandy
    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
    c                   eval      text = %ucs2(sOut + x’52′ + x’8D’ + sIn)      to
    c                   eval      text = %ucs2(sOut + x’52′ + x’8D’ + sIn :1130)
    
    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>
    5,860 pointsBadges:
    report
  • nta2804
    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
    35 pointsBadges:
    report
  • nta2804
    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.
    35 pointsBadges:
    report

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