ILE RPG Header for NLS Data Conversion APIs, iconv.rpgleinc, is a subproject of i5/OS Programmer's Toolkit .
It provides prototypes of NLS data conversion APIs and declarations related data structures. For detail documentation of NLS data conversion APIs, please refer to the Information Center:
Topics
svn export https://i5toolkit.svn.sourceforge.net/svnroot/i5toolkit/rpg/iconv.rpgleinc
After exporting the source stream file of iconv.rpgleinc, you can upload it to your IBM i server either as a stream file in the IFS or as a source PF member by FTP. Make sure that iconv.rpgleinc can be seen by the RPG compiler by setting a proper value of the INCDIR parameter of CRTBNDRPG or CRTRPGMOD when you compiling a RPG source unit that includes iconv.rpgleinc.
h dftactgrp(*no) /copy iconv d cd ds likeds(iconv_t) d tocode ds likeds(qtqcode_t) d fromcode ds likeds(qtqcode_t) d rtn s 10i 0 d ustr s 8a inz(x'6161626263636464') d inbufptr s * inz(%addr(ustr)) d inlen s 10u 0 inz(8) d str s 8a d outbufptr s * inz(%addr(str)) d outlen s 10u 0 inz(8) /free tocode = *allx'00'; tocode.ccsid = 37; fromcode = *allx'00'; fromcode.ccsid = 1208; cd = QtqIconvOpen(tocode : fromcode); // check cd.rtn rtn = iconv( cd : inbufptr : inlen : outbufptr : outlen ); dsply 'EBCDIC string' '' str; rtn = iconv_close(cd); *inlr = *on; /end-free
Example Sources | Description
|
t132.rpgle | Convert a ASCII string to an EBCDIC string with CCSID 935.
|