Support This Project Get i5/OS Programmer's Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads

ILE RPG Header for NLS Data Conversion APIs

Go back to main page of project i5/OS Programmer's Toolkit .

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

How to Get iconv.rpgleinc

To get the ILE RPG Header for NLS Data Conversion APIs, iconv.rpgleinc, you may download and install the last release package of project i5/OS Programmer's Toolkit by visiting the following link: http://sourceforge.net/projects/i5toolkit/files/ . You may also check it out from the project's SVN repository seperately like the following:
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.

Getting Started with ILE RPG Header for NLS Data Conversion APIs

Here is a "Hello world" example of utilizing NLS Data Conversion APIs that are prototyped in 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 List

List of examples that utilize prototypes of ICONV APIs and ICONV exit program parameter structures.

Example Sources Description

t132.rpgle Convert a ASCII string to an EBCDIC string with CCSID 935.


Support This Project
Generated on Mon Oct 3 04:10:44 2011 for i5/OS Programmer's Toolkit: System-builtin Headers for ILE RPG by  doxygen 1.5.9